32 lines
602 B
PHP
32 lines
602 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class AppNotification extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'app_notifications';
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'body',
|
|
'severity',
|
|
'is_active',
|
|
'created_by',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function reads(): HasMany
|
|
{
|
|
return $this->hasMany(AppNotificationRead::class, 'notification_id');
|
|
}
|
|
}
|