Global scope preventing DB seeding
I am using Laravel spark, and I am restricting team access to models by employing a scope that is implemented in a trait namespace App\Scopes; use Illuminate\Database\Eloquent\Scope; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; class TeamScope implements Scope { /** * Apply the scope to a given Eloquent query builder. * * @param \Illuminate\Database\Eloquent\Builder $builder * @param \Illuminate\Database\Eloquent\Model $model * @return void */ public function apply(Builder $builder, Model $model) { $builder->where('team_id', '=',Auth()->user()->currentTeam-
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.