I'm starting with Laravel 5, and I want do everything right. I'm doing "Post" with Json, and I wanna implement CSRF Protection but I don't know how can I do that on my JSON. I saw so many examples with AJAX but with JSON I didn't found none.
I need to set manually every token for person or laravel do that automatically?
How can i pass token as argument on that JSON ?
That is my JSON:
{
"foo":"bar"
}
That's my controller code:
public function Register()
{
$teste = Request::json()->all();
return $teste;
}
I'm using all protection default from Laravel on middleware.