Un-butcher task system.

This commit is contained in:
Dane Everitt
2017-04-15 13:52:43 -04:00
parent 0fe9a4566e
commit 7f1a97184b
12 changed files with 154 additions and 77 deletions

View File

@@ -49,8 +49,10 @@ class Task extends Model
*/
protected $casts = [
'id' => 'integer',
'server' => 'integer',
'queued' => 'integer',
'user_id' => 'integer',
'server_id' => 'integer',
'queued' => 'boolean',
'active' => 'boolean',
];
/**
@@ -59,4 +61,24 @@ class Task extends Model
* @var array
*/
protected $dates = ['last_run', 'next_run', 'created_at', 'updated_at'];
/**
* Gets the server associated with a task.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function server()
{
return $this->belongsTo(Server::class);
}
/**
* Gets the user associated with a task.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function user()
{
return $this->belongsTo(User::class);
}
}