| Package Data | |
|---|---|
| Maintainer Username: | sleeping-owl |
| Maintainer Contact: | owl.sleeping@yahoo.com (Sleeping Owl) |
| Package Create Date: | 2015-02-03 |
| Package Last Update: | 2015-02-05 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-03 15:16:37 |
| Package Statistics | |
|---|---|
| Total Downloads: | 250 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 5 |
| Total Watchers: | 1 |
| Total Forks: | 5 |
| Total Open Issues: | 1 |
Add sleeping-owl/route-priority to composer.json.
"sleeping-owl/route-priority": "1.*"
Run composer update to pull down the latest version of the package. Now open up app/config/app.php and add the service provider to your providers array.
'providers' => array(
'SleepingOwl\RoutePriority\RoutePriorityServiceProvider'
)
That's it. You now have some enhanced functionality available to your routes.
Now you can change your routes priority:
Route::get('my-route', ['uses' => 'MyController@myAction'])->setPriority(100);
Priority is integer value.
Default priority is 50 - already registered routes count. So if you want higher priority - use values from 50 and above, lower priority - 10 and below.
Route::get('/user/{wildcard}', …);
Route::get('/user/settings', …);
This code will register two routes. With default Laravel behaviour second route will not work. Just add priority to the first route to fix the error:
Route::get('/user/{wildcard}', …)->setPriority(0);
Route::get('/user/settings', …);
Second route now has higher priority and will work.
You can donate in BTC: 13k36pym383rEmsBSLyWfT3TxCQMN2Lekd
Package was written by Sleeping Owl for the Laravel framework and is released under the MIT License. See the LICENSE file for details.