laravel - 路线 [people.comments] 未定义
问题描述
帮我找出问题,laravel项目在加载前给出错误
路线 [people.comments] 未定义
我复制并粘贴了路线名称,复制并粘贴了工作路线,但不,它不起作用。
Route::post('/people/comments', 'Admin\PeopleController@comments')->name('people.comments');
当我将方法 POST 更改为 GET Route::get('/people/comments', 'Admin\PeopleController@comments')->name('people.comments');
我在 JAVASCRIPT 中使用这条路线
let url = '{{ route("people.comments") }}';
现在的问题是为什么当我更改帖子以获得它时它会起作用?为什么它不能在 POST 中工作?(我没有同名的路线)谢谢
解决方案
这是我的错误两个帖子具有相同的地址和相同的方法
Route::post('/people/comments', 'Admin\PeopleController@comments')->name('people.comments');
Route::post('/people/comments', 'Admin\PeopleController@blogs')->name('people.blogs');
推荐阅读
- javascript - 图片未在点击时下载,而不是打开图片的 URL
- elasticsearch - Xpack 是否必须用于加密的跨集群搜索
- django - 在 Form/Formwizard 中动态填充 ChoiceField Select
- c# - 有没有办法从一组具有不同值类型的字典中通用地返回一个值?
- git - git-svn 克隆所有历史记录,但只克隆当前在 HEAD 版本中的内容
- asp.net-mvc - 当日期列等于特定值时如何以不同方式显示?
- android - Google 地图如何在不使用前台服务的情况下知道我的位置?
- swift - 将 [UInt8] 的部分转换为 UInt8
- android - sdk 28 中的音频流
- java - 在主函数中使用超出范围的变量