2017 © Pedro Peláez
 

library laravel-extended-resource-registrar

Extension for Laravel Router and ResourceRegistrar to handle softDeletes and simple delete without HTTP DELETE method

image

sjorsvanleeuwen/laravel-extended-resource-registrar

Extension for Laravel Router and ResourceRegistrar to handle softDeletes and simple delete without HTTP DELETE method

  • Thursday, March 1, 2018
  • by sjorsvanleeuwen
  • Repository
  • 1 Watchers
  • 0 Stars
  • 52 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 8 % Grown

The README.md

Laravel Extended Resource Registrar

Latest Version on Packagist ![Software License][ico-license] Total Downloads, (*1)

This is a package to extend the resource registrar with Laravel 5. It includes a ServiceProvider to register the new router., (*2)

Installation

Require this package with composer. It is recommended to only require the package for development., (*3)

composer require sjorsvanleeuwen/laravel-extended-resource-registrar

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider., (*4)

Make sure to change your app/Http/Kernel.php like so, (*5)

/**
 * Get the route dispatcher callback.
 * Do this to make the new Router work
 *
 * @return \Closure
 */
protected function dispatchToRouter()
{
    $this->router = $this->app['router'];

    foreach ($this->middlewareGroups as $key => $middleware)
    {
        $this->router->middlewareGroup($key, $middleware);
    }

    foreach ($this->routeMiddleware as $key => $middleware)
    {
        $this->router->aliasMiddleware($key, $middleware);
    }

    return parent::dispatchToRouter();
}

THe reason for this addition: The default router is already bound and passed on to the kernel before other serviceproviders are loaded, the kernel does not know about the new Router and can not load the routes registered because they are registered with the new router and the kernel bound in public/index.php has the default router bound., (*6)

Laravel 5.5+:

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php, (*7)

Sjorsvanleeuwen\ExtendedResourceRegistrar\ServiceProvider::class,

Lumen:

Not tested with Lumen, (*8)

Usage

You can now create a resourceful route with softDeletes, (*9)

Route::resource('foo', 'FooController')->withSoftDeletes();

The Versions

01/03 2018

dev-master

9999999-dev

Extension for Laravel Router and ResourceRegistrar to handle softDeletes and simple delete without HTTP DELETE method

  Sources   Download

MIT

The Requires

 

by Sjors van Leeuwen

laravel extension resource router

01/03 2018

0.5

0.5.0.0

Extension for Laravel Router and ResourceRegistrar to handle softDeletes and simple delete without HTTP DELETE method

  Sources   Download

MIT

The Requires

 

by Sjors van Leeuwen

laravel extension resource router

05/12 2017

0.4

0.4.0.0

Extension for Laravel Router and ResourceRegistrar to handle softDeletes and simple delete without HTTP DELETE method

  Sources   Download

MIT

The Requires

 

by Sjors van Leeuwen

laravel extension resource router

05/12 2017

0.3

0.3.0.0

Extension for Laravel Router and ResourceRegistrar to handle softDeletes and simple delete without HTTP DELETE method

  Sources   Download

MIT

The Requires

 

by Sjors van Leeuwen

laravel extension resource router

29/09 2017

0.2

0.2.0.0

Extension for Laravel Router and ResourceRegistrar to handle softDeletes and simple delete without HTTP DELETE method

  Sources   Download

MIT

The Requires

 

by Sjors van Leeuwen

laravel extension resource router

27/09 2017

0.1

0.1.0.0

Extension for Laravel Router and ResourceRegistrar to handle softDeletes and simple delete without HTTP DELETE method

  Sources   Download

MIT

The Requires

 

by Sjors van Leeuwen

laravel extension resource router