Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Allow loading trashed models for resource routes #44405

Merged
merged 4 commits into from
Oct 4, 2022

Conversation

browner12
Copy link
Contributor

This change gives the ability to load trashed models when registering a route resource.

You can load trashed models on all the resource routes by calling withTrashed() with no parameters:

Route::resource('users', UserController::class)->withTrashed();

You can selectively load trashed models on methods by passing an array:

Route::resource('users', UserController::class)->withTrashed(['show']);

This change gives the ability to load trashed models when registering a route resource.

You can load trashed models on **all** the resource routes by calling `withTrashed()` with no parameters:

```php
Route::resource('users', UserController::class)->withTrashed();
```

You can selectively load trashed models on methods by passing an array:

```php
Route::resource('users', UserController::class)->withTrashed(['show']);
```
@taylorotwell taylorotwell merged commit 1fa2669 into laravel:9.x Oct 4, 2022
@browner12 browner12 deleted the resource-routes-with-trash branch October 4, 2022 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants