adding draft subtask logic to backend

This commit is contained in:
StudioTem committed 2025-12-03 09:57:12 +01:00
1 parent 570e29e5c4
commit 21ad81cee7
5 files changed
+136 -11

No files matched your search

+16
View File
@@ -13,6 +13,22 @@ class SubTask extends Model
public $timestamps = true;
public $guarded = ['id'];
/**
* Scope pre koncepty (drafty) - nezverejnené subtasky
*/
public function scopeDraft($query)
{
return $query->where('is_draft', true);
}
/**
* Scope pre publikované subtasky (nie drafty)
*/
public function scopePublished($query)
{
return $query->where('is_draft', false);
}
public function mastertask()
{
return $this->belongsTo(MasterTask::class, 'master_task_id');