ahmmmmad11/inhanced-routing 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱: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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固