1. Go to this page and download the library: Download laikait/laika-route 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/ */
// Basic
Url::group('admin', function () {
Url::get('/dashboard', 'Admin\DashboardController@index');
});
// Nested (inherits parent's pipeline/filter)
Url::group('admin', function () {
Url::group('billing', function () {
Url::get('/invoices', 'Admin\Billing\InvoiceController@index');
})->pipeline(['Permission|perm=billing.view']);
})->pipeline(['Auth']);
// Chained pipeline + filter (applied retroactively to all routes in group)
Url::group('api', function () {
Url::post('/payments', 'PaymentController@store')->pipeline(['ApiKey']);
})->pipeline(['Cors'])->filter(['LogApi']);
// Per group prefix
Url::fallback('admin', fn() => '<h1>Admin route not found</h1>');
// Default (no prefix)
Url::fallback(null, fn() => '<h1>Page not found</h1>');
Url::dispatch();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.