Creating a Button Element

Problem

You want to create a button element in your Blade template.

Solution

Use the Form::button() method.

Specify the value as the first argument.

{{ Form::button('Hit Me') }}

The HTML produced is very simple.

<button type="button">Hit Me</button>

Use the second argument to add additional attributes.

{{ Form::button('Hit Me', array('class' => 'btn')) }}

And now resulting the button has a class.

<button class="btn" type="button">Hit Me</button>

Discussion

Nothing to discuss.

comments powered by Disqus