0
I just started messing with Laravel and I wanted to know what it is token that is fundamental in the forms
<form action="/contato" method="POST">
{{csrf_field()}}
<label>Nome</label>
<input type="text" name="nome" placeholder="Nome/Post">
<button>enviar</button>
</form>
This answers your question? What is the use of csrf_token present in Laravel’s layout file?
– Boi Programador
I want to point out that the linked answer in the question that @Boiprogramador is wrong, has NOTHING TO DO WITH AJAX, CSRF is to help avoid forms coming from other sites to execute requests on your site, however CSRF is not by far an infallible technique, On the contrary, it is quite easy to circumvent it, it is more guaranteed to use a system similar to reCaptcha (there are others), CSRF is only costly to your site in Laravel (Aravel is already disastrous in performance by itself) and it won’t be safe, just avoid attacks coming from things created by those who have no experience.
– Guilherme Nascimento