default attributes */ protected $attributes = [ // phpcs:ignore 'description' => '', 'url' => '', 'transaction_id' => null, 'updated_by' => null, ]; /** @var bool enable timestamps */ public $timestamps = true; // phpcs:ignore /** @var array */ protected $casts = [ // phpcs:ignore 'shift_type_id' => 'integer', 'location_id' => 'integer', 'created_by' => 'integer', 'updated_by' => 'integer', 'start' => 'datetime', 'end' => 'datetime', ]; /** @var array Values that are mass assignable */ protected $fillable = [ // phpcs:ignore 'title', 'description', 'url', 'start', 'end', 'shift_type_id', 'location_id', 'transaction_id', 'created_by', 'updated_by', ]; public function neededAngelTypes(): HasMany { return $this->hasMany(NeededAngelType::class); } public function schedule(): HasOneThrough { return $this->hasOneThrough(Schedule::class, ScheduleShift::class, null, 'id', null, 'schedule_id'); } public function shiftEntries(): HasMany { return $this->hasMany(ShiftEntry::class); } public function shiftType(): BelongsTo { return $this->belongsTo(ShiftType::class); } public function location(): BelongsTo { return $this->belongsTo(Location::class); } public function createdBy(): BelongsTo { return $this->belongsTo(User::class, 'created_by'); } public function updatedBy(): BelongsTo { return $this->belongsTo(User::class, 'updated_by'); } }