更新时间:2022-01-05 22:29:25
当您应该改为使用->
时,您正在静态访问ajax()
方法(使用::
):
You're accessing the ajax()
method statically (using ::
), when you should be using ->
instead:
if ($request->ajax()) {
使用Laravel日志文件
如评论中所述,Laravel可能在storage/logs/laravel.log
中告诉了您这一点,并附带了很长的调用堆栈跟踪(您提到的行,以#38"和#39"开头).只需向上滚动到#1"之前,您就会找到罪魁祸首.
As mentioned in the comments, Laravel is probably telling you this in storage/logs/laravel.log
, complete with a long call-stack trace (the lines that you mentioned, beginning with "#38" and "#39"). Just scroll up to before "#1" and you'll find your culprit.