dragon-code / extended-routes
This helper extends the standard set of resource routing methods to work with SoftDeletes and other extends
Fund package maintenance!
Boosty
Yoomoney
Donationalerts
Installs: 7 446
Dependents: 2
Suggesters: 0
Security: 0
Stars: 17
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: ^8.1
- illuminate/database: ^10.0 || ^11.0
- illuminate/routing: ^10.0 || ^11.0
- illuminate/support: ^10.0 || ^11.0
Requires (Dev)
- orchestra/testbench: ^8.0 || ^9.0
- phpunit/phpunit: ^10.0
README
This helper extends the standard set of resource routing methods to work with SoftDeletes and other extends.
Installation
Compatibility
To get the latest version of Extended Routes
, simply require the project using Composer:
$ composer require dragon-code/extended-routes
Instead, you may of course manually update your require block and run composer update
if you so choose:
{ "require": { "dragon-code/extended-routes": "^4.0" } }
Upgrade from andrey-helldar/extended-routes
- In your
composer.json
file, replace"andrey-helldar/extended-routes": "^2.0"
with"dragon-code/extended-routes": "^3.0"
. - Replace the
Helldar\ExtendedRoutes
namespace prefix withDragonCode\ExtendedRoutes
in your app; - Run the
command composer
update. - Profit!
Using
With trait
use DragonCode\ExtendedRoutes\Routing\ModelBindingResolver; use DragonCode\ExtendedRoutes\Traits\ExtendedSoftDeletes; class Page extends Model { use ExtendedSoftDeletes; }
Extends of the abstract model
use DragonCode\ExtendedRoutes\Models\ExtendedSoftDeletes; //use Illuminate\Database\Eloquent\SoftDeletes; class Foo extends ExtendedSoftDeletes { //use SoftDeletes; << need to remove conflicting trait. }
Routes
app('router')->apiRestorableResource('foos', 'FoosController'); // or Route::apiRestorableResource('foos', 'FoosController');
Referencing is also available:
use App\Http\Controllers\FoosController; app('router')->apiRestorableResource('foos', FoosController::class); // or Route::apiRestorableResource('foos', FoosController::class);
License
This package is licensed under the MIT License.
This package was written with the participation of Maksim (Ellrion) Platonov under MIT License.