📜  如何更改资源路由参数 lravel - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:30.183000             🧑  作者: Mango

代码示例1
By default, Route::resource will create the route parameters
for your resource routes based on the "singularized" version
of the resource name. You can easily override this on a per resource 
basis using the parameters method. The array passed into the parameters
method should be an associative array of resource names and parameter names:

use App\Http\Controllers\AdminUserController;

Route::resource('users', AdminUserController::class)->parameters([
    'users' => 'admin_user'
]);