33 lines
664 B
PHP
33 lines
664 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Console\View\Components\Task;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Support\Facades\DB;
|
||
|
|
|
||
|
|
|
||
|
|
class TaskDuration extends Model
|
||
|
|
{
|
||
|
|
use HasFactory;
|
||
|
|
|
||
|
|
protected $table = 'tasks_duration';
|
||
|
|
public $timestamps = false;
|
||
|
|
protected $fillable = [
|
||
|
|
'task_id',
|
||
|
|
'duration',
|
||
|
|
'start',
|
||
|
|
'end',
|
||
|
|
'user_id',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function task(){
|
||
|
|
return $this->belongsTo(Tasks::class, 'task_id', 'id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function user()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'user_id', 'id');
|
||
|
|
}
|
||
|
|
}
|