'required|string|min:2|max:225', ]; } protected $casts = [ 'private' => 'boolean' ]; public function getValueOf(?string $key) { $values = [ 'business_id' => $this->business_id, 'project_id' => $this->project_id, 'sprint_id' => null, 'workflow_id' => null, 'status_id' => null, 'system_id' => $this->id, '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 project() { return $this->belongsTo(Project::class, 'project_id', 'id'); } public function tasks() { return $this->hasMany(Task::class, 'sub_project_id', 'id'); } }