PHP code example of xinningsu / laravel-route-trailing-slash
1. Go to this page and download the library: Download xinningsu/laravel-route-trailing-slash 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/ */
xinningsu / laravel-route-trailing-slash example snippets
use App\Http\Controllers\PartnersController;
Route::get('/partners/', [PartnersController::class, 'index'])->name('partners');
echo route('partners');
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
$app->register(Sulao\LRTS\Routing\RoutingServiceProvider::class);
[
Illuminate\Pagination\PaginationServiceProvider::class,
// ...
/*
* Package Service Providers...
*/
Sulao\LRTS\Pagination\PaginationServiceProvider::class,
// ...
];
\Sulao\LRTS\Routing\Router::$mismatchAction = 404;
\Sulao\LRTS\Routing\Router::$mismatchAction = 301;