30 lines
527 B
PHP
30 lines
527 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class AlertNotification extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'alert_id',
|
||
|
|
'value',
|
||
|
|
'message',
|
||
|
|
'is_read',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected function casts(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'value' => 'decimal:2',
|
||
|
|
'is_read' => 'boolean',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function alert(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Alert::class);
|
||
|
|
}
|
||
|
|
}
|