Thu Feb 13
Query a group of records based on parameters deep in a parent relation.
$files = \App\Models\File::whereHas('material', function(\Illuminate\Database\Eloquent\Builder $material) {
$material->whereHas('category', function(\Illuminate\Database\Eloquent\Builder $category) {
$category->whereHas('bucket', function(\Illuminate\Database\Eloquent\Builder $bucket) {
$bucket->where('path', 'vbs-2020-focus');
});
});
})->toSql();