1

I'm working on the project using Laravel 5.5. I have resource controller and trying to save data in store method. The route looks like this:

  Route::resource('post', 'Post\PostController');

This is Store method in the controller:

public function store(Request $request)
{
    dd($request);
}

And also I have got blade with form like this:

  <form action="/post" method="POST">
        {{ csrf_field() }}

But I have error and don't understand what is the issue. Clicking on submit, I see this error: The page has expired due to inactivity. Please refresh and try again.

Also I see 419 status error in the google chrome console.

By the way, if I change form method from post to get,and also change url, it works.But using non resource controller with post method it does not work again.

Can someone tells me what's wrong here, thanks.

Just want to remind that the problem isn't solved yet. Any suggestions?

LTM
  • 33
  • 1
  • 7
  • Have you checked these answers [link 1](https://stackoverflow.com/questions/46141705/the-page-has-expired-due-to-inactivity-laravel-5-5), [link 2](https://www.5balloons.info/fixed-page-expired-due-inactivity-laravel-5/) – yrv16 Feb 01 '18 at 14:30
  • Thanks, yes I have checked the links you've mentioned. When I add protected $except = [ 'your/route' ]; to VerifyCsrfToken middleware, it works. – LTM Feb 02 '18 at 08:17
  • You are welcome. You should understand that in this case you excluded csrf protection. – yrv16 Feb 02 '18 at 08:34
  • yes I understand that, I was just trying to figure out what is the issue. So it's consider to csrftoken, but I don't really know what should I do to find a solution. – LTM Feb 02 '18 at 08:48

0 Answers0