Files
approagency/app/Models/Reminder.php
T
2025-12-18 18:23:17 +03:30

37 lines
855 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Enums\ReminderType;
class Reminder extends Model
{
use HasFactory;
protected $guarded = [];
protected $casts = [
'data' => 'array',
'last_repeat' => 'datetime',
'type' => ReminderType::class,
];
public function packageName()
{
return $this->belongsTo(PackageName::class);
}
// public function setTimeAttribute($value)
// {
// $this->attributes['time'] = \Carbon\Carbon::parse($value)->format('Y-m-d H:i:s.u');
// }
// public function getTimeAttribute($value)
// {
// return $value; // Return as is, or format if needed
// }
public function user()
{
return $this->belongsTo(User::class);
}
}