This commit is contained in:
Adrian Hopek
2022-01-26 10:56:25 +01:00
parent 026bfe485f
commit f3559930c2
28 changed files with 1015 additions and 31 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace Toby\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
use Toby\Enums\VacationType;
/**
* @property int $id
* @property VacationType $type
* @property Carbon $from
* @property Carbon $to
* @property string $comment
* @property User $user
*/
class VacationRequest extends Model
{
use HasFactory;
protected $casts = [
"type" => VacationType::class,
"from" => "date",
"to" => "date",
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}