أُنشئ من Tokal/Test
42 أسطر
820 B
PHP
42 أسطر
820 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class ReservationReminder extends Model
|
|
{
|
|
use HasFactory;
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'reservation_id',
|
|
'user_id',
|
|
'remind_at',
|
|
'send_at',
|
|
'sent_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'remind_at' => 'datetime',
|
|
'send_at' => 'datetime',
|
|
'sent_at' => 'datetime',
|
|
];
|
|
|
|
public function setSendAtAttribute($value): void
|
|
{
|
|
$this->attributes['remind_at'] = $value;
|
|
}
|
|
|
|
public function getSendAtAttribute()
|
|
{
|
|
return $this->attributes['remind_at'] ?? null;
|
|
}
|
|
|
|
public function reservation()
|
|
{
|
|
return $this->belongsTo(Reservation::class);
|
|
}
|
|
}
|