RSS

Monthly Archives: October 2017

Laravel Load Custom Error Views

This piece of code shows how to load different error views for each exceptions occurred, The display can be controlled depending on the context.

public function render($request, Exception $e)
{
if ($e instanceof HttpException) {
$statusCode = $e->getStatusCode();

if (view()->exists('errors.'.$statusCode)) {
return response(view('errors.'.$statusCode, [
'msg' => $e->getMessage(),
'code' => $statusCode
]), $statusCode);
}
}

return parent::render($request, $e);
}
 
Leave a comment

Posted by on October 25, 2017 in Laravel, PHP

 

Tags:

Video

C# How to add pagination in DataGridView

 
Leave a comment

Posted by on October 23, 2017 in C#.Net

 

Tags: