Guntar Guntar - 1 month ago 7
PHP Question

Laravel Collective HTML5 attributes

How do I pass in an HTML5 attributes like: required, auto focus...?

I can enter other attributes which have name="value", but not an attribute that consist of only one word.

Answer

Pass the array with values as third (for select as fourth) parameter:

{!! Form:: text('name', null, ['required' => true, 'some-param' => 'itsValue', 'class' => 'some-class' ]) !!}