Ehtesham Shami
Ehtesham Shami

Reputation: 125

How to use Bootstrap with Laravel 5?

I am new to Laravel, I am trying to use Bootstrap with Laravel but it is very difficult to use with it.

Form::submit('save',array('class'=>'btn btn-primary'));

This is the syntax used for the bootstrap styling. If we are using this every time we have to write bootstrap class name by ourself there is no auto-complete syntax intellisense. This is not the case in CodeIgniter. So if any one know how we can gain auto-complete classes of bootstrap with Laravel syntax please tell me.

Upvotes: 2

Views: 3994

Answers (1)

Joey
Joey

Reputation: 1267

I don't use purely the laravel form helpers (except the opening and closing as that produces the required CRF tokens)

{{ Form::open() }}
<div class="text-left" style="font-width:100;">
  <div class="form-group">
    <label for="inputEmail">Email address</label>
    <input type="email" class="form-control" required="required" name="email" id="inputEmail" placeholder="[email protected]" value="{{Input::old('email')}}">
  </div>
  <div class="form-group">
    <label for="inputName">Name</label>
    <input type="name" class="form-control" required="required" name="name" id="inputName" placeholder="Hoo Beau" value="{{Input::old('name')}}">
  </div>
  <div class="form-group">
    <label for="inputTel">Phone</label>
    <input type="tel" class="form-control" name="tel" id="inputTel" placeholder="555.655.4555" value="{{Input::old('tel')}}">
  </div>
  <div class="form-group">
    <label for="inputMsg">Message</label>
    <textarea class="form-control" id="inputMsg" required="required" name="message" rows="3" placeholder="Whats up?">{{Input::old('message')}}</textarea>
  </div>
  <button type="submit" class="btn btn-default">Submit</button>
</div>
{{ Form::close() }}

Upvotes: 2

Related Questions