Skip to content

bs-thomas/laravel-advanced-route

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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');
});

About

An advanced route for Laravel to support controllers

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%