Form Helpers
Available Methods
Method Listing
csrf_field()
The csrf_field
function generates an HTML hidden
input field containing the value of the CSRF token. For example, using Blade syntax:
{{ csrf_field() }}
csrf_token()
The csrf_token
function retrieves the value of the current CSRF token:
$token = csrf_token();
honeypot_fields()
The honeypot_fields
method generates hidden
HTML input fields to help combat spam. For example, using Blade syntax:
{{ honeypot_fields() }}
render_form()
The render_form
method will render a complete HTML form for the given form.
render_form('contact_us');
By default, this will use a standard HTML view template based on Bootstrap. You may however, override this and use your own view template by specifying the second parameter with the path to your view file. Lastly, to forward along any additional data to your custom view, you may provide the third parameter with a key-value array.
render_form('contact_us', 'forms.custom', ['lorem' => 'ipsum']);