-
app/Models/User.php
Open in GitHubuse Illuminate\Database\Eloquent\Builder; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable // public function scopeAuthors(Builder $query): Builder { return $query->whereHas('roles', function ($query) { $query->where('roles.name', Role::ROLE_ADMIN) ->orWhere('roles.name', Role::ROLE_EDITOR); }); } // }