下面是我们整理的php的laravel学习的常见的错误以及解决的办法,我还会持续更新,请关注



## 错误1:

错误代码:

1
No message

错误原因:

1
查看这个路由参数,缺少参数

解决办法:

1
此路由缺少参数


## 错误2:

错误代码:

1
localhost/ Failed to load resource: the server responded with a status of 404

错误原因:

1
图片找不到

解决办法:

1
在报错的img中添加src


## 错误3:

错误代码:

1
Invalid argument supplied for foreach() (View: D:\Laravel\resources\views\Personal\qtspace.blade.php)

错误原因:

1
sql错误

解决办法:

1
将 Blog::where('user_id',$user_id)->whereIn('accessable',['public','protected'])->toSql() 改为 Blog::where('user_id',$user_id) ->whereIn('accessable',['public','protected'])->get();


## 错误4:

错误代码:

1
Parse error: syntax error, unexpected '$data' (T_VARIABLE), expecting ',' or ')' (View: D:\shixiaoxia\laravel123\test\resources\views\face\face.blade.php

错误原因:

1
解析错误:语法错误、意想不到的“$DATA”(TY变量)、期望“、”或“”(视图:D:\ SHIXXIIA\LARAVEL123\Test\Reals\View \Foo\FACE.BLADE.PHP

解决办法:

1
解析错误:语法错误、意想不到的“$DATA”(TY变量)、期望“、”或“”(视图:D:\ SHIXXIIA\LARAVEL123\Test\Reals\View \Foo\FACE.BLADE.PHP


## 错误5:

错误代码:

1
Class App\Http\Request\FaceRequest does not exist.

错误原因:

1
找不到类

解决办法:

1
在request后边添加s