承接 giuga/laravel-ordered-routes 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

giuga/laravel-ordered-routes

Composer 安装命令:

composer require giuga/laravel-ordered-routes

包简介

Set order for routes defined in web.php

README 文档

README

Add order to routes

Install the package

composer require giuga/laravel-ordered-routes

Change the default application loaded in bootstrap/app.php

Find

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

Replace with

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

Change the default Route alias in config/app.php

Find

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

Replace with

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

routes/web.php

By using this package you have the ability to define routes in what ever order you want.

In the example below the {slug?} would catch also the home route even if this was not our intention. By defining an order, if the requested url matches a predefined route like /home and /home does not have a higher order number than {slug?} home will be used.

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

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固