nwidart / httpstatus
HttpStatus 是一个添加美观错误页面的小型包。
dev-master
2014-09-20 13:22 UTC
Requires
- php: >=5.3.0
- illuminate/support: 4.*|5.*
This package is auto-updated.
Last update: 2024-09-08 06:22:18 UTC
README
HttpStatus
HttpStatus 是一个添加美观错误页面的小型包。
它监听 App::error()
和 App::down()
以提供错误页面。注意,这些错误页面只有在 debug
设置为 true
时才会显示。
安装
将 nwidart/httpstatus
添加到 composer.json
的需求中
{
...
"require": {
...
"nwidart/httpstatus": "dev-master"
},
}
更新 composer
$ php composer.phar update
将 'Nwidart\Httpstatus\HttpstatusServiceProvider'
添加到您的 app/config/app.php
文件中的 providers
数组中。
(可选) 发布包配置
$ php artisan config:publish nwidart/httpstatus
配置
配置文件发布后,您可以返回自己的错误视图。您可以为每个错误提供视图
return array(
'views' => array(
'403' => 'errors.your403',
'404' => 'errors.your404',
'500' => 'errors.your500',
'503' => 'errors.your503',
)
);
致谢
它受到 Traffic-Signs 的启发