Ad

Laravel 5 Csrf_token Value Is Empty

- 1 answer

Why laravel 5 csrf_token value is empty always ?

How can i get that token value ?

I tried,

  {!! csrf_token !!} , {{ csrf_token }} and 
  {{ Form::open() }} ....{{ Form::close() }}

MY OUTPUT

  <input type="hidden" name="_token"></input>
Ad

Answer

It's because you're not using the web group middleware. Laravel is smart enough to know that if you're not using that group a token is not necessary.

Try moving your route inside the Route::group(['middleware' => 'web'] ... and tell us about it :)

Source: I made the same mistake not too long ago.

Ad
source: stackoverflow.com
Ad