当前位置:网站首页>New routing file in laravel framework
New routing file in laravel framework
2022-06-26 12:22:00 【Special sword】
Laravel Add routing file
Laravel8.x Add a new route file method
- Go to the project root directory \app\Providers\RouteServiceProvider.php
- stay public function boot() Method to add a new routing file address , Here's the picture
Route::prefix('merchants/v1_0') # Prefix ->middleware('api') # middleware ->namespace($this->namespace) ->group(base_path('routes/merchants_v1_0.php'));# The path where the new route file is located

Laravel5.x Add a new route file method
- Get into Project root \app\Providers\RouteServiceProvider.php In file
- Add a custom method in this file mapApiRoutes_v1_0() The method name is defined by itself , My custom name is mapApiRoutes_v1_0
- In the custom method **mapApiRoutes_v1_0()** Add the following code to
/** * api v1.0 Version routing file */ protected function mapApiRoutes_v1_0() { Route::prefix('api') # Route prefix ( There can be no ) ->middleware('api') # middleware ->namespace($this->namespace) ->group(base_path('routes/api_v1_0.php')); # Location of the new route file } - stay **\app\Providers\RouteServiceProvider.php Find map() Method will be the custom method we just added mapApiRoutes_v1_0()** Add in
/** * Define the routes for the application. * * @return void */ public function map() { $this->mapApiRoutes(); $this->mapWebRoutes(); // $this->mapApiRoutes_v1_0();#api v1.0 Version routing file ←←←←← The routing file method we just added $this->mapApiRoutes_v1_1();#api v1.1 Version routing file $this->mapWebApiRoutes_v1_0();#WebApi v1.0 Version routing file }

End;
边栏推荐
- [probability theory] conditional probability, Bayesian formula, correlation coefficient, central limit theorem, parameter estimation, hypothesis test
- Cross platform members get through the two channels of brand Ren Du
- 女性科学家的流失
- Question B of 2016 Sichuan Ti Cup Electronic Design Competition
- 利用 Repository 中的方法解决实际问题
- Report on in-depth analysis and investment strategy recommendations for China's petroleum coke industry (2022 Edition)
- HUST网络攻防实践|6_物联网设备固件安全实验|实验二 基于 MPU 的物联网设备攻击缓解技术
- Cet article présente la moyenne mobile quadratique linéaire et le fonctionnement simple d'Excel pour réaliser la prédiction des séries chronologiques dans la modélisation.
- Spark-day02-core programming-rdd
- [redis series] redis learning 16. Redis Dictionary (map) and its core coding structure
猜你喜欢

【毕业季·进击的技术er】忆毕业一年有感
![[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure](/img/d2/a6cbb0abe9e04c412d1f6021430528.png)
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure

HUST网络攻防实践|6_物联网设备固件安全实验|实验三 FreeRTOS-MPU 保护绕过

HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 2 MPU based IOT device attack mitigation technology

Loggie encoding and newline character test

Ctfshow web getting started command execution web75-77

Re recognized! Know that Chuangyu has been selected as one of the first member units of the "business security promotion plan"

18: Chapter 3: development of pass service: 1: SMS login & registration process, introduction; (SMS verification code is used here)

Realize microservice load balancing (ribbon)

Statistical genetics: Chapter 1, basic concepts of genome
随机推荐
What determines the rent
Analysis report on China's photovoltaic inverter market prospect forecast and investment strategy recommendations in 2022
2016年四川省TI杯电子设计竞赛B题
HUST网络攻防实践|6_物联网设备固件安全实验|实验二 基于 MPU 的物联网设备攻击缓解技术
Redis cannot connect to the server through port 6379
大智慧哪个开户更安全,更好点
PolarisMesh系列文章——概念系列(一)
Current situation investigation and investment prospect forecast analysis report of China's electrolytic copper market from 2022 to 2028
利用 Repository 中的方法解决实际问题
【Redis 系列】redis 学习十六,redis 字典(map) 及其核心编码结构
How can we reach members more effectively?
Precautions for opening a securities account is it safe to open an account
Lintcode 130 · stacking
I'd like to know what preferential activities are available for stock account opening? Is it safe to open an account online?
2022 China smart bathroom cabinet Market Research and investment Competitiveness Analysis Report
房租是由什么决定的
Statistical genetics: Chapter 2, the concept of statistical analysis
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure
Prospering customs through science and technology, Ronglian and Tianjin Customs jointly build a genomic database and analysis platform
What are the top ten securities companies? Is it safe to open a mobile account?