'bail|required|string|min:2|max:225', 'started_at' => 'bail|required|date|date_format:Y-m-d', 'ended_at' => 'bail|required|date|date_format:Y-m-d|after:started_at', 'active' => 'nullable|boolean', 'description' => 'nullable|string|min:2|max:1000', ]; } protected $casts = [ 'active' => 'boolean' ]; public function getValueOf(?string $key) { $values = [ 'business_id' => $this->business_id, 'project_id' => $this->project_id, 'sprint_id' => $this->id, 'workflow_id' => null, 'status_id' => null, 'system_id' => null, 'user_id' => null, 'task_id' => null, 'subject_id' => $this->id, ]; if ($key && isset($values, $key)) { return $values[$key]; } return $values; } public function business() { return $this->belongsTo(Business::class, 'business_id', 'id'); } public function projects() { return $this->belongsTo(Project::class, 'project_id', 'id'); } public function tasks() { return $this->hasMany(Task::class, 'sprint_id', 'id'); } }