2017 © Pedro Peláez
 

package server-error-pages

Laravel server-side error pages

image

enniosousa/server-error-pages

Laravel server-side error pages

  • Tuesday, May 22, 2018
  • by enniosousa
  • Repository
  • 1 Watchers
  • 5 Stars
  • 42 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 3 Versions
  • 320 % Grown

The README.md

Laravel Server Error Pages

Latest Stable Version Total Downloads License, (*1)

Table of Contents

Errors Avaliables

  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 405 Method not allowed
  • 419 Authentication Timeout
  • 429 Too Many Requests
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout
  • Maintenance (used when php artisan down)

Languages Avaliables

Installation

Step 1:Install package via Composer, (*2)

composer require enniosousa/server-error-pages

Step 2: If you are using Laravel 5, include the service provider within your config/app.php file., (*3)

'providers' => [
    EnnioSousa\ServerErrorPages\ServerErrorPagesServiceProvider::class,
];

Step 3: Publish vendor provider, (*4)

php artisan vendor:publish --provider="EnnioSousa\ServerErrorPages\ServerErrorPagesServiceProvider"

How to Create Custom Error Pages

Step 1: Create new empty file named with HTTP code error at folder resources/views/errors like specified in Laravel docs., (*5)

Step 2: Put the following content in the file you just created., (*6)

@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:, (*7)

<?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"
              ],
          ],
      ],
];

Custom Error Messages

Use abort() Laravel helper, (*8)

abort(500, "The server is broken");
abort(403, "You user role does not heave permission to see that.");

Or, (*9)

php artisan down --message="This application is update process. Wait 10 minutes and try again." --retry=600

The Versions

22/05 2018

dev-master

9999999-dev

Laravel server-side error pages

  Sources   Download

Apache-2.0

The Requires

 

by Ennio Sousa

laravel error pages

22/05 2018

v1.0.2

1.0.2.0

Laravel server-side error pages

  Sources   Download

Apache-2.0

The Requires

 

by Ennio Sousa

laravel error pages

06/02 2018

v1.0.0

1.0.0.0

Laravel server-side error pages

  Sources   Download

Apache-2.0

The Requires

 

by Ennio Sousa

laravel error pages