2015-05-27 18:52:10 +02:00
|
|
|
<?php namespace App\Models;
|
|
|
|
|
|
|
|
use DB;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
|
|
|
class Task extends EntityModel
|
|
|
|
{
|
|
|
|
use SoftDeletes;
|
|
|
|
|
|
|
|
public function account()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('App\Models\Account');
|
|
|
|
}
|
|
|
|
|
2015-06-14 16:49:13 +02:00
|
|
|
public function invoice()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('App\Models\Invoice');
|
|
|
|
}
|
|
|
|
|
2015-05-27 18:52:10 +02:00
|
|
|
public function client()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('App\Models\Client')->withTrashed();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Task::created(function ($task) {
|
|
|
|
//Activity::createTask($task);
|
|
|
|
});
|
|
|
|
|
|
|
|
Task::updating(function ($task) {
|
|
|
|
//Activity::updateTask($task);
|
|
|
|
});
|
|
|
|
|
|
|
|
Task::deleting(function ($task) {
|
|
|
|
//Activity::archiveTask($task);
|
|
|
|
});
|
|
|
|
|
|
|
|
Task::restoring(function ($task) {
|
|
|
|
//Activity::restoreTask($task);
|
|
|
|
});
|