37 lines
849 B
PHP
37 lines
849 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\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);
|
|
}
|
|
}
|