PHP code example of bluegeek / route-for-laravel

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/ */

    

bluegeek / route-for-laravel example snippets


protected $commands = [
    ...
    \Waterloocode\Router\Console\Commands\MakeRoute::class,
    ...
];

    
    /**
    * 使用方式和原本的一样
    */
    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