PHP code example of vod / laravel-typed-routes

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

    

vod / laravel-typed-routes example snippets


return [
    'output_path' => 'resources/routes.d.ts',
];

Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');
Route::get('/example/{id}/hello', [ExampleController::class, 'hello'])->name('example.hello');
Route::put('/example/{id}/update', [ExampleController::class, 'update'])->name('example.update');

bash
php artisan vendor:publish --tag="laravel-typed-routes-config"
bash
php artisan typescript:transform-routes