Difference Between csrf_field(), csrf_token() and method_field()
This tutorial is for What is The Difference Between csrf_field(), csrf_token() and method_field(). Here is the artile about What is The Difference Between csrf_field(), csrf_token(),method_field() with example.
csrf_field()
The csrf_field function generates an HTML hidden input field containing the value of the CSRF token.
Use : {{ csrf_field() }}
csrf_token()
The csrf_token function retrieves the value of the current CSRF token:
Use : $token = csrf_token();
method_field()
The method_field function generates an HTML hidden input field containing the spoofed value of the form’s HTTP verb.
Use :
<form method="POST" action="#">
{{ method_field('DELETE') }}
</form>