@extends('gallery.layouts.app') @section('content')

Top Photos

@foreach(\App\Gallery::where('status','Approved')->get() as $gallery)
{{sizeof(Storage::disk('public')->files($gallery->slug))}}
{{$gallery->title}}

{{$gallery->photographer->name}}

@endforeach
View More

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
@endsection @section('style') @endsection