$this->business_id, 'project_id' => null, 'sprint_id' => null, '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 rules() { return [ 'label' => 'required|string|min:3|max:225', 'color' => 'nullable|string|min:2|max:255', ]; } public function business() { return $this->belongsTo(Business::class,'business_id','id',__FUNCTION__); } public function task() { return $this->belongsToMany( Task::class,'tag_task','tag_id','task_id', 'id','id',__FUNCTION__ ); } }