mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
adding draft subtask logic to backend
This commit is contained in:
1 parent
570e29e5c4
commit
21ad81cee7
5 files changed
+136
-11
No files matched your search
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user