Skip to content

SerializesAndRestoresModelIdentifiers ignores global scopes for models during restoring models for jobs from queue #60160

@siarheipashkevich

Description

@siarheipashkevich

Laravel Version

13.9.0

PHP Version

8.4.16

Database Driver & Version

MySQL 8.0.41

Description

I have global scope for my model:

Image

And use queuable job where I'm using Illuminate\Foundation\Queue\Queueable trait for serializing/deserializing model:

Image

And my global scope from the model is ignored: select * from saleswheresales.id = 8 limit 1

I investigated this problem and found that the vendor/laravel/framework/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php uses method:

Image Image

Is it ok?

Steps To Reproduce

Please see the description below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions