cyanobacteria / laravel-sub-routes
a plugin to split Route files
2.1.0
2019-05-07 03:24 UTC
Requires
- php: >=7.1.0
README
- a simple route spliter by folders
- set perfix default by fileName
- can set middlewares or not (need to create a file.php under config folder)
- only for laravel
- need atleast laravel 5.5 or up
- project create on laravel 5.7
Getting Started
- download and require yourself (git clone or just download)
git clone https://github.com/Cyanobacteria/laravel-sub-route.git
- use composer
composer require cyanobacteria/laravel-sub-routes
Prerequisites
laravel and atleast version 5.5
Installing
- do Getting Started and success
- use on laravelProjectRoot/App/ServiceProviders/RouteServiceProvider.php
//in RouteServiceProvider.php
public function map()
{
$this->mapApiRoutes(); //<--laravel originSet
$this->mapWebRoutes(); //<--laravel originSet
// we will add
$subRoute=new LaravelSubRoutes(['configPath'=>'yourConfigFileName']);
$subRoute->mapSubRoutes(['subRouteFolderName'=>'yourSubRouteFolderName']);
/*
projectRootPath/config/yourConfigFileName.php
projectRootPath/routes/yourSubRouteFolderName/
*/
// we will add
}
- php artisan route:clear
License
This project is licensed under the MIT License - see the LICENSE.md file for details