34 lines
639 B
PHP
34 lines
639 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class TimesheetEntry extends Model
|
|
{
|
|
protected $fillable = [
|
|
'timesheet_id',
|
|
'date',
|
|
'user_id',
|
|
'description',
|
|
'hours',
|
|
'billed'
|
|
];
|
|
|
|
protected $casts = [
|
|
'date' => 'datetime',
|
|
'billed' => 'boolean',
|
|
'hours' => 'float'
|
|
];
|
|
|
|
public function timesheet(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Timesheet::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
} |