Top Photos
@foreach(\App\Gallery::where('status','Approved')->get() as $gallery)
@endforeach
View More
{{$gallery->title}}
{{$gallery->photographer->name}}
Top Photographers
@foreach(\App\User::whereHas('role', function (\Illuminate\Database\Eloquent\Builder $query) {
$query->where('name', '=', 'photographer');
})->get()->take(6) as $index=>$photographer)
@if(\App\Gallery::where('user_id',$photographer->id)->where('status','Approved')->count() >0)
@if($index % 2 == 0)
@else
@endif
@endif
@endforeach
All Photographers