2017 © Pedro Peláez
 

library laravel-resource-route-wildcard-alias

Laravel resource route wildcard alias to use same model name in route model binding with alias

image

arifmahmudrana/laravel-resource-route-wildcard-alias

Laravel resource route wildcard alias to use same model name in route model binding with alias

  • Friday, February 12, 2016
  • by arifmahmudrana
  • Repository
  • 2 Watchers
  • 1 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

:Laravel 5 Resource Route Wildcard Alias

Usage

Step 1: Install Through Composer

composer require arifmahmudrana/laravel-resource-route-wildcard-alias

Step 2: Add the Service Provider

Add service providers to providers array in config/app.php. Like so:, (*1)

AriMahmudRana\laravelResourceRouteWildcardAlias\LaravelResourceRouteWildcardAliasServiceProvider::class

and that's it., (*2)

Examples

Create resource routes with aliases., (*3)

Route::group(['middleware' => ['web']], function () {
    Route::resource('album.photo.hello', 'PhotoController', ['alias' => ['album' => 'a', 'photo' => 'p', 'hello' => 'h']]);
});

and the output in php artisan route:list is., (*4)

+--------+-----------+------------------------------------+---------------------------+----------------------------------------------+------------+
| Domain | Method    | URI                                | Name                      | Action                                       | Middleware |
+--------+-----------+------------------------------------+---------------------------+----------------------------------------------+------------+
|        | GET|HEAD  | /                                  |                           | Closure                                      |            |
|        | POST      | album/{a}/photo/{p}/hello          | album.photo.hello.store   | App\Http\Controllers\PhotoController@store   | web        |
|        | GET|HEAD  | album/{a}/photo/{p}/hello          | album.photo.hello.index   | App\Http\Controllers\PhotoController@index   | web        |
|        | GET|HEAD  | album/{a}/photo/{p}/hello/create   | album.photo.hello.create  | App\Http\Controllers\PhotoController@create  | web        |
|        | DELETE    | album/{a}/photo/{p}/hello/{h}      | album.photo.hello.destroy | App\Http\Controllers\PhotoController@destroy | web        |
|        | PUT|PATCH | album/{a}/photo/{p}/hello/{h}      | album.photo.hello.update  | App\Http\Controllers\PhotoController@update  | web        |
|        | GET|HEAD  | album/{a}/photo/{p}/hello/{h}      | album.photo.hello.show    | App\Http\Controllers\PhotoController@show    | web        |
|        | GET|HEAD  | album/{a}/photo/{p}/hello/{h}/edit | album.photo.hello.edit    | App\Http\Controllers\PhotoController@edit    | web        |
+--------+-----------+------------------------------------+---------------------------+----------------------------------------------+------------+

License

Released under the MIT License, see LICENSE., (*5)

The Versions

12/02 2016

dev-master

9999999-dev

Laravel resource route wildcard alias to use same model name in route model binding with alias

  Sources   Download

MIT

The Requires

 

by Arif Mahmud Rana

laravel alias model route resource binding

12/02 2016

v1.0.0

1.0.0.0

Laravel resource route wildcard alias to use same model name in route model binding with alias

  Sources   Download

MIT

The Requires

 

by Arif Mahmud Rana

laravel alias model route resource binding