PHP code example of jornatf / laravel-route-generator

1. Go to this page and download the library: Download jornatf/laravel-route-generator 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/ */

    

jornatf / laravel-route-generator example snippets


return [
        
    /*
    |--------------------------------------------------------------------------
    | View base path
    |--------------------------------------------------------------------------
    |
    | Specify here the folder containing the blade views for the routes. This
    | base will not be in the URL.
    |
    */

    'view_base_path' => 'static',

    /*
    |--------------------------------------------------------------------------
    | URL prefix
    |--------------------------------------------------------------------------
    |
    | Here you can specify a URL prefix. By default the value is null.
    |
    */

    'url_prefix' => null,

    /*
    |--------------------------------------------------------------------------
    | Midlewares
    |--------------------------------------------------------------------------
    |
    | You can specify the middlewares that should be used for all automatically
    | generated URLs.
    |
    */

    'middlewares' => [],
];

'url_prefix' => 'my_prefix',

'middlewares' => ['auth:sanctum'],
bash
php artisan vendor:publish --tag="laravel-route-generator-config"

resources/
├─ views/
│  ├─ static/
│  │  ├─ about.blade.php
│  │  ├─ contact.blade.php

php artisan generated-route:list