承接 ahmmmmad11/inhanced-routing 相关项目开发

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

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

ahmmmmad11/inhanced-routing

最新稳定版本:1.0.0

Composer 安装命令:

composer require ahmmmmad11/inhanced-routing

包简介

alternative laravel routing package

README 文档

README

extends Laravel routing package to add more functionality, For this version we provide the ability to allow multiple explicit route binding fields.

Installation

composer required ahmmmmad11/enhanced-routing

Now open config/app.php and add the service provider to your providers array.

'providers' => [
/*
 * Package Service Providers...
 */
 
 \Ahmmmmad11\Routing\RoutingServiceProvider::class,
]

then go to app/Http/Kernal and add the follwing code

//import Router class and Application Interface
use Ahmmmmad11\Routing\Router;
use Illuminate\Contracts\Foundation\Application;

// add this constructer inside Kernal class
public function __construct(Application $app, Router $router)
{
    $this->app = $app;
    $this->router = $router;

    $this->syncMiddlewareToRouter();
}

usage

if you successfully intalled the package now you can bind multiple fields to the route

Route::get('users/{user:email,username,id}', function(User $user) {
    return $user;
});

now you can access this route in many ways, like:

// http://127.0.0.1:8000/users/1
or
// http://127.0.0.1:8000/users/firstuser@example.com
or
// http://127.0.0.1:8000/users/firstuser

warning
please allways place numeric fields (int, float and ...) as the last options for example do {user:email,username,id} not {user:id,email,username}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-01