I am using Laravel 5.4 and I have a blade file that has many Form sections. One of my Form sections pulls items from my database and displays the items as checkboxes for my form. I am trying to manipulate the code so that my checkbox items appear in two columns, side-by-side rather than just being displayed in a line one after the other.
Here is the code I am trying to manipulate:
<div id="field-container" class="form-group ">
{!! Form::label('categories', 'Categories', ['class' => 'req col-sm-offset-1 col-sm-3 control-label']) !!}
<div class="checkbox-group">
@foreach ($dep_dep_cats['categories'] as $oneCategory)
{!! Form::checkbox('categories[]', $oneCategory['id'] ) !!}
{!! $oneCategory['title'] !!}
@endforeach
</div>
{!! $errors->has('categories') ? '<p class="col-sm-8 col-sm-offset-4 text-danger"><strong>' . $errors->first('categories') . '</strong></p>' : '' !!}
</div>
I was thinking that I could throw in an if statement to align items a certain way based on their id but I was not able to get this to work. I also put a <div> around the Blade syntax form items inside of my @foreach loop and this lined my items up into one big column, which is closer to what I am going for. How can I split that large column into two smaller columns?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire