Fix task collection attach relation
This commit is contained in:
@@ -44,6 +44,16 @@ class Task extends Model
|
||||
return $this->belongsTo(TaskCollection::class, 'collection_id');
|
||||
}
|
||||
|
||||
public function taskCollections(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
TaskCollection::class,
|
||||
'task_collection_task',
|
||||
'task_id',
|
||||
'task_collection_id'
|
||||
)->withPivot(['sort_order']);
|
||||
}
|
||||
|
||||
public function tenant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Tenant::class);
|
||||
|
||||
Reference in New Issue
Block a user