Short: Is there a way to generate a CSRF token in the controller (not in a view)?
Long: I have a web app that users stay logged in for long periods of time. CSRF tokens expire, so I have the script updating them every 10 minutes. Right now I've hacked it together by having a view that generates JSON, but that's ugly. And I now want to use the periodic refresh to include other data.
You have access to that token via the helper csrf_token()
or if you have access to a request $request->session()->token()
.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community