1. Go to this page and download the library: Download bluegeek/route-for-laravel 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/ */
/**
* 使用方式和原本的一样
*/
namespace HomeRoutes;
use Illuminate\Contracts\Routing\Registrar;
class HomeRoutes
{
public function map(Registrar $router)
{
}
}
/**
* 使用方式和原本的一样
*/
namespace HomeRoutes;
use Illuminate\Contracts\Routing\Registrar;
class HomeRoutes
{
public function map(Registrar $router)
{
$router->group(["prefix"=>"user"], function ($router) {
$router->get("/",function(){
dd("this is a user");
});
});
}
}
php artisan make:route HomeRoutes
php artisan route:cache
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.