0 Best Reply Awards

  • Member Since 3 Years Ago
  • 167 Lessons Completed
  • 41 Favorites

26th May, 2015

Mashauri left a reply on [L5] Avoiding CSRF Middleware On API POST Routes • 3 years ago

@billmn post gave an idea, all you have to do just open this file app/Http/Middleware/VerifyCsrfToken.php and add 'api/*' in protected $except array. Works for me and is clean way to exception routes.

use Closure; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

class VerifyCsrfToken extends BaseVerifier { /** * The URIs that should be excluded from CSRF verification. * * @var array / protected $except = [ 'api/' ]; }

Edit Your Profile

Want to change your profile photo? We pull from