正常使用resource进行访问 自带的几个增删改查方法
Route::resource('/image_text', 'ImageTextController');
如果仅仅访问其中一个方法/操作,使用only 进行限定
Route::resource('/image_text', 'ImageTextController', ['only' => ['show','index']]);
本文介绍如何利用Laravel中的Resource路由特性,访问控制器中的增删改查等预定义方法。通过Route::resource指令,可以快速地为资源创建一组标准的CRUD路由。同时,文章还演示了如何使用only参数来限定仅访问特定的方法,如'show'和'index'。
正常使用resource进行访问 自带的几个增删改查方法
Route::resource('/image_text', 'ImageTextController');
如果仅仅访问其中一个方法/操作,使用only 进行限定
Route::resource('/image_text', 'ImageTextController', ['only' => ['show','index']]);

被折叠的 条评论
为什么被折叠?