Skip to content

A simple way to reorganize your routes in Laravel 5.2

Notifications You must be signed in to change notification settings

itisjustlu/routesfolder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#Routes Folder for Laravel 5.2

###Why should I use this package? If you're tired to use one file to organize your routes, here is the solution. You can have many files inside your Routes folder. This package will load these files automatically and print all of your routes

How to install?

Add to your composer.json

composer require lucasruroken/routesfolder ~1.0

Add the following provider to your config/app.php

LucasRuroken\RoutesFolder\RoutesFolderProvider::class

###How to use? You need to create a Routes directory in your app/Http folder. Then you can create all the files you want to organize your routes.

Example:

app/Http/Routes/UserRoutes.php

<?php

namespace App\Http\Routes;

use LucasRuroken\RoutesFolder\RoutesFolderInterface;

class UserRoutes implements RoutesFolderInterface{

    public function routes(){

        \Route::get('/user', function(){

            print('User Route');
        });
    }
}

Don't forget to match the file name with the Class name. The class needs to implements RoutesFolderInterface

That's all

About

A simple way to reorganize your routes in Laravel 5.2

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages