RSS

Category Archives: Laravel

Video

Laravel 5 Audits and Logs

Advertisements
 
Leave a comment

Posted by on November 18, 2017 in Laravel, PHP

 

Tags:

Video

Laravel 5.5 Jwt Authentication

 
Leave a comment

Posted by on November 14, 2017 in Laravel, PHP

 

Tags: ,

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:

How to enable CORS in Laravel 5

How to enable CORS in Laravel 5

1. Add middleware
php artisan make:middleware Cors

return $next($request)
->header(‘Access-Control-Allow-Origin’, ‘*’)
->header(‘Access-Control-Allow-Methods’, ‘GET, POST, PUT, DELETE, OPTIONS’);

2. Register middleware as a route middleware

3. Use middleware in routes which support CORS

 
1 Comment

Posted by on April 20, 2017 in Laravel

 

Tags: ,

Laravel 5.1 Useful Resources

 

Hosting

Lumen

https://github.com/lucadegasperi/oauth2-server-laravel

http://esbenp.github.io/2015/05/26/lumen-web-api-oauth-2-authentication/

http://mrgott.com/joomla/24-integrate-oauth2-server-into-lumen-to-secure-your-restful-api-with-access-tokens

http://loige.co/developing-a-web-application-with-lumen-and-mysql/

 

 
Leave a comment

Posted by on September 12, 2016 in Laravel, PHP

 

Tags: