PHP code example of giuga / laravel-ordered-routes

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

    

giuga / laravel-ordered-routes example snippets


composer 

$app = new \Illuminate\Foundation\Application(
    realpath(__DIR__.'/../')
);

$app = new \Giuga\Application(
    realpath(__DIR__.'/../')
);

'aliases' => [
...
'Route' => Illuminate\Support\Facades\Route::class,
...

'aliases' => [
...
'Route' => Giuga\Routing\Facades\OrderRoute::class,
...

Route:get('{slug?}', function($slug){ return $slug; } )->name('named.slug')->order(999);
Route:get('/home'), function(){ return 'This is my Home'; })->name('home');