Skip to content

Instantly share code, notes, and snippets.

View mbpcoder's full-sized avatar

Mahdi Bagheri mbpcoder

View GitHub Profile
@mbpcoder
mbpcoder / Handler.php
Last active June 30, 2017 20:00
My render function in Laravel exception Handler Class
public function render($request, Exception $exception)
{
$statusCode = 0;
if ($this->isHttpException($exception)) {
$statusCode = $exception->getStatusCode();
}
if (in_array($statusCode, [401, 403, 404, 503])) {
return $this->renderHttpException($exception);
} elseif (app()->environment() == 'production') {