Laravel5.3 问题记录

SQLSTATE[42S22]: Column not found: 1054 Unknown column

不出意外是这个字段名写错了

laravel5.3 app\Http\Middleware\Authenticate.php不存在,无法设置跳转页

在app\Exceptions\Handler.php中修改

array_merge(): Argument #1 is not an array

如果是$request的话,改成$request->all()即可,因为$request是对象,而非数组。

如何在Laravel 5.3 下使用 HTML 和 Form

在composer.json的require中加入

1
"laravelcollective/html": "~5.1"

然后执行

1
composer update

config/app.php中加入

1
2
3
4
5
6
7
8
9
return [
'providers' => [
Collective\Html\HtmlServiceProvider::class,
],
'aliases' => [
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
]
]

Form request显示为Forbidden

检查authorize属性是否为false(true为登录状态时验证,false则所有请求都验证。)

1
2
3
public function authorize(){
return true;
}

laravel缓存优化

1
2
3
4
5
6
7
8
// 创建
php artisan optimize // 加载类
php artisan config:cache // 配置文件
php artisan route:cache // 路由
// 清除
php artisan clear-compiled
php artisan config:clear
php artisan route:clear

评论区