PHP code example of cyanobacteria / laravel-sub-routes
1. Go to this page and download the library: Download cyanobacteria/laravel-sub-routes library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cyanobacteria / laravel-sub-routes example snippets
//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
}