Blogger Information
Blog 23
fans 0
comment 0
visits 18967
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
婚恋网后台的资源路由 普通控制器和资源控制器
手机用户1617360551
Original
600 people have browsed it

婚恋网后台的资源路由 普通控制器和资源控制器


通过 Artisan 命令工具建立后台所需要的普通控制器,和资源控制器


为控制器创建相应的路由,资源路由通过Route::resource创建

  1. //项目后台路由
  2. Route::get('/admin/home/welcome',[\App\Http\Controllers\Admin\IndexController::class,'index'])
  3. ->name('admin.index');
  4. //会员资源路由
  5. Route::resource('/admin/home/user',\App\Http\Controllers\Admin\UserController::class);
  6. //会员权限资源路由
  7. Route::resource('/admin/home/purchase',\App\Http\Controllers\Admin\PurchaseController::class);
  8. //会员注册登录路由
  9. Route::get('damin/home/login',[\App\Http\Controllers\Admin\LoginController::class,'index'])
  10. ->name('admin.login');
  11. //会员管理路由
  12. Route::resource('/admin/home/order',\App\Http\Controllers\Admin\OrderController::class);
  13. //问题管理路由
  14. Route::resource('admin/home/question',\App\Http\Controllers\Admin\QuestionController::class);

上图

通过vagrant@homestead:~/code/marriage$ php artisan route:list命令获取路由列表

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