The submit button

Lastly, the submit button will be converted as follows:

<button type="submit" class="btn btn-primary" style="margin-right: 15px;">

The preceding code after conversion is as follows:

        ['class'=>'btn btn-primary', 
        'style'=>'margin-right: 15px;'])


Note that the array parameter provides an easy way to provide any desired attributes, even those that are not among the list of standard HTML form elements.

The anchor tag with links

To convert the links, a helper method is used. Consider the following line of code:

<a href="/password/email">Forgot Your Password?</a>

The preceding line of code after conversion becomes:

{!! link_to('/password/email', $title = 'Forgot Your Password?', $attributes = array(), $secure = null) !!}


The link_to_route() method may be used to link to a route. For similar helper functions, visit

Closing the form

To end the form, we’ll convert the traditional HTML form tag </form> to a Laravel {!! Form::close() !!} form method.

The resultant form

By putting everything together, the page now looks like this:

<div class="container-fluid">
  <div class="row">
    <div class="col-md-8 col-md-offset-2">
      <div class="panel panel-default">
        <div class="panel-heading">Login</div>
          <div class="panel-body">
            @if (count($errors) > 0)
                <div class="alert alert-danger">
                    <strong>Whoops!</strong> There were some problems with your input.<br><br>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
            <?php $inputAttributes = ['class'=>'form-control'];
                $labelAttributes = ['class'=>'col-md-4 control-label']; ?>
            {!! Form::open(['class'=>'form-horizontal','role'=>'form','method'=>'POST','url'=>'/auth/login']) !!}
                <div class="form-group">
                    {!! Form::label('email', 'E-Mail Address',$labelAttributes) !!}
                    <div class="col-md-6">
                    {!! Form::input('email','email',old('email'), $inputAttributes) !!}
                <div class="form-group">
                    {!! Form::label('password', 'Password',$labelAttributes) !!}
                    <div class="col-md-6">
                        {!! Form::input('password','password',null,$inputAttributes) !!}
                <div class="form-group">
                    <div class="col-md-6 col-md-offset-4">
                        <div class="checkbox">
                             {!! Form::checkbox('remember','') !!} Remember Me
                <div class="form-group">
                    <div class="col-md-6 col-md-offset-4">
                        {!! Form::submit('Login',['class'=>'btn btn-primary', 'style'=>'margin-right: 15px;']) !!}
                        {!! link_to('/password/email', $title = 'Forgot Your Password?', $attributes = array(), $secure = null); !!}
            {!! Form::close() !!}