*/ protected $fillable = [ // phpcs:ignore 'name', 'description', 'contact_name', 'contact_dect', 'contact_email', 'restricted', 'requires_driver_license', 'no_self_signup', 'show_on_dashboard', 'hide_register', ]; /** @var array */ protected $casts = [ // phpcs:ignore 'restricted' => 'boolean', 'requires_driver_license' => 'boolean', 'no_self_signup' => 'boolean', 'show_on_dashboard' => 'boolean', 'hide_register' => 'boolean', ]; public function shiftEntries(): HasMany { return $this->hasMany(ShiftEntry::class); } public function userAngelTypes(): BelongsToMany { return $this ->belongsToMany(User::class, 'user_angel_type') ->using(UserAngelType::class) ->withPivot(UserAngelType::getPivotAttributes()); } public function hasContactInfo(): bool { return !empty($this->contact_name) || !empty($this->contact_dect) || !empty($this->contact_email); } /** * @codeCoverageIgnore For some reasons parent::boot get s ignored here 0o */ protected static function boot(): void { parent::boot(); static::addGlobalScope('order', fn(Builder $builder) => $builder->orderBy('name')); } }