lucasruroken / routesfolder
A simple package to organize your routes
Installs: 15 045
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
This package is not auto-updated.
Last update: 2025-01-18 21:24:58 UTC
README
#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