enniosousa/server-error-pages is a Laravel package for laravel server-side error pages.
It currently has 16 GitHub stars and 5.594 downloads on Packagist (latest version v1.1.0).
Install it with composer require enniosousa/server-error-pages.
Discover more Laravel packages by enniosousa
or browse all Laravel packages to compare alternatives.
Last updated
php artisan down)Step 1:Install package via Composer
composer require enniosousa/server-error-pages
Step 2: If you are using Laravel 5, include the service provider within your config/app.php file.
'providers' => [
EnnioSousa\ServerErrorPages\ServerErrorPagesServiceProvider::class,
];
Step 3: Publish vendor provider
php artisan vendor:publish --provider="EnnioSousa\ServerErrorPages\ServerErrorPagesServiceProvider"
Step 1: Create new empty file named with HTTP code error at folder resources/views/errors like specified in Laravel docs.
Step 2: Put the following content in the file you just created.
@include('server-error-pages::template', compact($exception))
Step 3: Add to file resrouces/lang/vendor/en/server-error-pages.php custom messages following the template:
<?php
return [
'000' => [
'title' => "000 HTTP ERROR",
'description' => "Brief description",
'icon' => "fa fa-cogs green", //icon color options are: green, orange or red
'button' => [
'name' => "Try This Page Again",
'link_to' => "reload", //options are: reload, home or previous
],
'why' => [
'title' => "What happened?",
'description' => "Error description"
],
'what_do' => [
'title' => "What can I do?",
'visitor' => [
'title' => "If you're a site visitor",
'description' => "Explanation."
],
'owner' => [
'title' => "If you're the site owner",
'description' => "Explanation"
],
],
],
];
Use abort() Laravel helper
abort(500, "The server is broken");
abort(403, "You user role does not heave permission to see that.");
Or
php artisan down --message="This application is update process. Wait 10 minutes and try again." --retry=600