24 lines
628 B
PHP
24 lines
628 B
PHP
<?php
|
|
|
|
namespace App\Domain\Reservations\Models;
|
|
|
|
use App\Domain\Inventory\Models\SnipeAsset;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class AssetBlock extends Model
|
|
{
|
|
protected $fillable = ['snipe_asset_id', 'starts_at', 'ends_at', 'reason', 'created_by'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['starts_at' => 'immutable_datetime', 'ends_at' => 'immutable_datetime'];
|
|
}
|
|
|
|
/** @return BelongsTo<SnipeAsset, $this> */
|
|
public function asset(): BelongsTo
|
|
{
|
|
return $this->belongsTo(SnipeAsset::class, 'snipe_asset_id');
|
|
}
|
|
}
|