laravel 7 中的路由问题查看仪表板文件夹中的文件夹名称仪表板新文件夹管理
Routing problem in laravel 7 in view a folder name dashboard in dashboard folder a new folder admin
我的问题是路由问题 website.com/dashboard/admin/ 但是这条路由不工作请
帮帮我
在视图文件夹中有一个仪表板文件夹,在仪表板文件夹中有一个新文件夹 admin
网页路由页面代码
Route::group(['middleware'=>['loginAuth']],function(){
Route:: resource('/dashboard','DashboardController');
Route:: resource('/dashboard/admin','AdminController');
});
您当前请求的视图不存在:
view('admin.index') // Looking for /views/admin/index.blade.php
根据你的文件结构,你需要调用如下视图:
view('dashboard.admin.index') // Looking for /views/dashboard/admin/index.blade.php
如文档所述:(https://laravel.com/docs/7.x/views#creating-views)
Views may also be nested within subdirectories of the resources/views directory.
"Dot" notation may be used to reference nested views. For example, if your view
is stored at resources/views/admin/profile.blade.php, you may reference it like
so:
return view('admin.profile', $data);
这种 Dot
表示法在 Laravel 中很常见,用于访问子文件夹元素 - 您也会在 blade 组件中看到它,例如 @extend
或 @include
我的问题是路由问题 website.com/dashboard/admin/ 但是这条路由不工作请 帮帮我
在视图文件夹中有一个仪表板文件夹,在仪表板文件夹中有一个新文件夹 admin
网页路由页面代码
Route::group(['middleware'=>['loginAuth']],function(){
Route:: resource('/dashboard','DashboardController');
Route:: resource('/dashboard/admin','AdminController');
});
您当前请求的视图不存在:
view('admin.index') // Looking for /views/admin/index.blade.php
根据你的文件结构,你需要调用如下视图:
view('dashboard.admin.index') // Looking for /views/dashboard/admin/index.blade.php
如文档所述:(https://laravel.com/docs/7.x/views#creating-views)
Views may also be nested within subdirectories of the resources/views directory. "Dot" notation may be used to reference nested views. For example, if your view is stored at resources/views/admin/profile.blade.php, you may reference it like so:
return view('admin.profile', $data);
这种 Dot
表示法在 Laravel 中很常见,用于访问子文件夹元素 - 您也会在 blade 组件中看到它,例如 @extend
或 @include