Created
February 2, 2016 11:05
-
-
Save plcosta/dc792d5a5d81cefea182 to your computer and use it in GitHub Desktop.
Using Laravel groupBy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@section('content') | |
<div class="row"> | |
@foreach($beds->groupBy('ward_id') as $key => $grouped) | |
<div class="col-sm-4"> <!-- ENFERMARIA --> | |
<div class="panel panel-default border-top-success border-bottom-success"> | |
<div class="panel-heading"><h5 class="panel-title">{{ $key }}</h5></div> | |
<div class="panel-body"> | |
@foreach($grouped as $bed) | |
<div class="col-sm-3"> | |
<div style="text-align: center;"> | |
<i class="fa fa-bed fa-2x" | |
data-popup="popover" | |
data-placement="top" | |
data-trigger="hover" | |
data-original-title="{{ isset($bed->name) ? $bed->name : 'Vago' }}" | |
data-content="{{$bed->bed_id}}" | |
></i><br/> | |
<h6>{{$bed->bed_id}}</h6> | |
</div> | |
</div> | |
@endforeach | |
</div> | |
</div> | |
</div> | |
@endforeach | |
</div><!-- row --> | |
@endsection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment