PHPackages                             mertyildiran/laravel-advanced-route - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. mertyildiran/laravel-advanced-route

ActiveLibrary[Framework](/categories/framework)

mertyildiran/laravel-advanced-route
===================================

Advanced route class for Laravel - restoring implicit controllers to the framework.

v1.6.2(7y ago)0131proprietaryPHP

Since Feb 9Pushed 6y agoCompare

[ Source](https://github.com/mertyildiran/laravel-advanced-route)[ Packagist](https://packagist.org/packages/mertyildiran/laravel-advanced-route)[ Docs](http://github.com/lesichkovm/laravel-advanced-route)[ RSS](/packages/mertyildiran-laravel-advanced-route/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

Laravel Advanced Route
======================

[](#laravel-advanced-route)

An advanced route for Laravel 5.3, 5.4, 5.5 and 5.6 to support controllers

Background
----------

[](#background)

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

Reason
------

[](#reason)

The default router is sufficient for small projects. Once the project starts to grow, placing all possible route definitions in the router file start to become harder to understand and follow. Quite often the router file becomes so messy, that the developer is afraid to modify/remove routes (even if these might be unused) in order to not break the application unexpectedly.

The AdvancedRoute::controller gives the control to the controller itself, and makes each controller responsible for its own routing (destiny).

Specifying the controller methods with get/post/any prefixes improves readability, and allows to easily understand what HTTP method is being used to call the functionality just by viewing the method.

Does your router file not fit the screen and you have to scroll to see all routes? Have you split your routes in separate router files, and included these in one router files? Do you not feel comfortable removing routes, as these might be used somewhere? Do you use names to "name" your routes? Then its time to think outside the box and go advanced.

How it works
------------

[](#how-it-works)

The advanced route allows you to easily define a single route to handle every action in a controller class. First, define the route using the AdvancedRoute::controller method. The controller method accepts two arguments. The first is the base URI the controller handles, while the second is the class name of the controller. Next, just add methods to your controller. The method names should begin with the HTTP verb they respond to followed by the title case version of the URI.

```
