*/ protected $fillable = [ 'competition_id', 'field_id', 'name', 'description', 'start_time', 'end_time', 'type', 'status', 'round', 'match_slot', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'start_time' => 'datetime', 'end_time' => 'datetime', ]; /** * Get the competition that this break period belongs to. */ public function competition(): BelongsTo { return $this->belongsTo(Competition::class); } /** * Get the field that this break period belongs to. */ public function field(): BelongsTo { return $this->belongsTo(Field::class); } /** * Get the teams that are on break during this period. */ public function teams(): BelongsToMany { return $this->belongsToMany(Team::class) ->withTimestamps(); } }