laravel5.3我遇到的问题


Route文件

{
    $router->get('shopType', 'shopTypeController@index');
    $router->get('/', 'shopController@index');
});

Controller文件

class ShopTypeController extends Controller
{
   public function index()
    {
       $shopTypes = ShopType::all();
       return view('admin.shopType.index',compact('shopTypes'));
    }
}

然后访问 http://localhost:8002/shop/shopType
报错信息如下:

ErrorException in FileViewFinder.php line 137: View [admin.index] not found. (View: E:\demo\resources\views\admin\shopType\index.blade.php)

理论上讲,他应该访问的是admin.shopType.index。这里是怎么把中间的省掉了。


点赞 取消点赞 收藏 取消收藏

<< 上一篇: 请教类似laravel/quickstart-basic这样的项目是如何创建开始的

>> 下一篇: 如何查询数据库中为空的值