Blogger Information
Blog 20
fans 0
comment 0
visits 10790
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
婚恋网站相关控制器和路由
麦兜的故事
Original
592 people have browsed it

1.创建相应控制器和路由

通过artisan命令创建资源控制器

为创建好的控制器设置相对应的路由
  1. //后台首页路由
  2. Route::get('/admin/home/index',[\App\Http\Controllers\Admin\IndexController::class,'index'])
  3. ->name('admin.index');
  4. //后台登录路由
  5. Route::get('/admin/home/login',[\App\Http\Controllers\Admin\LoginController::class,'login'])
  6. ->name('admin.login');
  7. //会员相关操作路由
  8. Route::resource('/admin/home/user',\App\Http\Controllers\Admin\UserController::class);
  9. //会员权限相关操作路由
  10. Route::resource('/admin/home/purchase',\App\Http\Controllers\Admin\PurchaseController::class);
  11. //会员问题路由
  12. Route::resource('/admin/home/question',\App\Http\Controllers\Admin\QuestionController::class);
  13. //订单操作路由
  14. Route::resource('/admin/home/order',\App\Http\Controllers\Admin\OrderController::class);
查看通过artisan命令创建的路由列表

查看指定路由操作处理

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post