CompanyableChildScope.php
Go to the documentation of this file.
1 <?php
2 namespace App\Models;
3 
5 use \Illuminate\Database\Eloquent\Builder;
6 use \Illuminate\Database\Eloquent\Scope;
7 
14 final class CompanyableChildScope implements Scope
15 {
22  public function apply(Builder $builder, Model $model)
23  {
24  $model = $builder->getModel();
25  return Company::scopeCompanyableChildren($model->getCompanyableParents(), $builder);
26  }
27 
35  public function remove(Builder $builder)
36  {
37  }
38 }
apply(Builder $builder, Model $model)
Apply the scope to a given Eloquent query builder.
Handle query scoping for full company support.
static scopeCompanyableChildren(array $companyable_names, $query)
Definition: Company.php:139