Add support for SoftDeletes models #669
Closed
lostgeek
started this conversation in
Feature Requests
Replies: 2 comments 2 replies
|
Ah sorry, I was looking for where to put feature requests and didn't look in discussions. |
1 reply
|
You can now add a class YourModel extends Model
{
public function scopeRunway($query)
{
return $query->withoutGlobalScopes();
}
}You can find more information on the docs: https://runway.duncanmcclean.com/resources#content-disabling-global-scopes |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
Laravel has a
SoftDeletestrait that enables models to be soft deleted. That means they will not appear in queries unless specifically queried with$query->withTrashed().Using
scopeRunwayListingit is possible to have soft-deleted entries to appear on the Runway listing, but when you try to edit a soft-deleted entry, you get a 404.As base support it would already be great, if you could mark a Runway resource as
softdeletablein the config, so that it is listed and fetched usingwithTrashed(). Ideally there would be an in-built way to display the deletion state to the user.Steps to reproduce
Environment
All reactions