You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
336 B

  1. <?php
  2. namespace App\Scopes;
  3. use Illuminate\Database\Eloquent\Builder;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Scope;
  6. class BusinessScope implements Scope
  7. {
  8. public function apply(Builder $builder, Model $model)
  9. {
  10. $builder->where('business_id', '=', request('business_id'));
  11. }
  12. }