'string', 'active' => 'boolean', 'color' => 'string', 'order' => 'integer', ]; public static function getTableName(): string { return with(new static())->getTable(); } public function tasks(): HasMany { return $this->hasMany(Task::class, 'status_id'); } /** * @return BelongsToMany */ public function projects(): BelongsToMany { return $this->belongsToMany(Project::class, 'projects_statuses', 'status_id', 'project_id')->withPivot('color'); } }