定制 sleeping-owl/route-priority 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sleeping-owl/route-priority

最新稳定版本:1.1.0

Composer 安装命令:

composer require sleeping-owl/route-priority

包简介

Package to add priority to Laravel routes

README 文档

README

Latest Stable Version License

Installation

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.

Usage

Now you can change your routes priority:

Route::get('my-route', ['uses' => 'MyController@myAction'])->setPriority(100);

Priority is integer value.

Default Priority

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.

Example

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.

Support Library

You can donate in BTC: 13k36pym383rEmsBSLyWfT3TxCQMN2Lekd

Copyright and License

Package was written by Sleeping Owl for the Laravel framework and is released under the MIT License. See the LICENSE file for details.

统计信息

  • 总下载量: 250
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-03