Resource routes for soft-deleted models (softResource & softApiResource) #58257
Unanswered
SaadMajeed565
asked this question in
Ideas
Replies: 1 comment 3 replies
-
|
Wouldn't this just duplicate the same routes without the softDeleted scope? You can do this even now using a diferent scope. |
Beta Was this translation helpful? Give feedback.
3 replies
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.
-
Currently, we have Route::resource() and Route::apiResource() which save time and help keep web.php or api.php clean.
I propose adding two new helper functions: softResource() and softApiResource(). These would automatically generate routes for soft-deleted models, including:
This would eliminate the need to define these routes manually. Often developers add these routes under show() or other routes, which can break RESTful URL conventions.
Having built-in support for soft-delete resource routes would make working with soft-deleted models more consistent and cleaner.
Beta Was this translation helpful? Give feedback.
All reactions