Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1010 Bytes

README.md

File metadata and controls

42 lines (32 loc) · 1010 Bytes

Laravel Advanced Route

An advanced route for Laravel 5.3 to support controllers

Background

In Laravel 5.3 the advanced functionality Route::controller was removed. This class fixes this shortcoming.

Installation

Add the following to your composer file:

   "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/lesichkovm/laravel-advanced-route.git"
        }
    ],
    "require": {
        "lesichkovm/laravel-advanced-route": "dev-master"
    },

Usage

Add the following line to where you want your controller to be mapped:

AdvancedRoute::controller('/{YOUR PATH}', '{YOUR CONTROLLER FULL NAME}');

Full Example:

Route::group(['prefix' => '/', 'middleware' => []], function () {
    AdvancedRoute::controller('/auth', 'AuthController');
    AdvancedRoute::controller('/cms', 'CmsController');
    AdvancedRoute::controller('/shop', 'ShopController');
    Route::any('/', 'WebsiteController@anyIndex');
});