Skip to content

Commit

Permalink
[10.x] Add warnings to scout and queue pages to clarify functionality (
Browse files Browse the repository at this point in the history
…#8787)

* Add warnings to scout and queue pages that indicate an unsupported use case

* wording

* Update queues.md

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
billypoke and taylorotwell committed May 15, 2023
1 parent 505747d commit eda5c2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions queues.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ Because loaded relationships also get serialized, the serialized job string can

Furthermore, when a job is deserialized and model relationships are re-retrieved from the database, they will be retrieved in their entirety. Any previous relationship constraints that were applied before the model was serialized during the job queueing process will not be applied when the job is deserialized. Therefore, if you wish to work with a subset of a given relationship, you should re-constrain that relationship within your queued job.

If a job receives a collection or array of Eloquent models instead of a single model, the models within that collection will not have their relationships restored when the job is deserialized and executed. This is to prevent excessive resource usage on jobs that deal with large numbers of models.

<a name="unique-jobs"></a>
### Unique Jobs

Expand Down
3 changes: 3 additions & 0 deletions scout.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ If you would like to modify the query that is used to retrieve all of your model
return $query->with('author');
}

> **Warning**
> The `makeAllSearchableUsing` method may not be applicable when using a queue to batch import models. Relationships are [not restored](/docs/{{version}}/queues#handling-relationships) when model collections are processed by jobs.
<a name="adding-records"></a>
### Adding Records

Expand Down

0 comments on commit eda5c2b

Please sign in to comment.