43 lines
991 B
PHP
Executable File
43 lines
991 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\MarkerFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property string $name
|
|
* @property string $color
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
*/
|
|
#[Fillable(['name', 'color', 'user_id'])]
|
|
class Marker extends Model
|
|
{
|
|
/** @use HasFactory<MarkerFactory> */
|
|
use HasFactory;
|
|
|
|
/**
|
|
* @return BelongsTo<User, $this>
|
|
*/
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
/**
|
|
* @return HasMany<VacationPeriod, $this>
|
|
*/
|
|
public function periods(): HasMany
|
|
{
|
|
return $this->hasMany(VacationPeriod::class);
|
|
}
|
|
}
|