PHP code example of creativeorange / pretty-error-pages
1. Go to this page and download the library: Download creativeorange/pretty-error-pages library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
creativeorange / pretty-error-pages example snippets
public function render($request, Throwable $e)
{
if ($this->isHttpException($e)) {
Route::any(request()->path(), function () use ($e, $request) {
return parent::render($request, $e);
})->middleware(config('pretty-error-pages.middleware'));
return app()->make(Kernel::class)->handle($request);
} else {
return parent::render($request, $e);
}
}