47 lines
883 B
PHP
47 lines
883 B
PHP
<?php
|
|
|
|
namespace App\Modules\Maintenance\Models;
|
|
|
|
use App\Business;
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class MaintenanceNotification extends Model
|
|
{
|
|
protected $table = 'maintenance_notifications';
|
|
|
|
protected $fillable = [
|
|
'business_id',
|
|
'user_id',
|
|
'type',
|
|
'title',
|
|
'message',
|
|
'data',
|
|
'channels',
|
|
'read_at',
|
|
'scheduled_at',
|
|
'sent_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'data' => 'array',
|
|
'channels' => 'array',
|
|
'read_at' => 'datetime',
|
|
'scheduled_at' => 'datetime',
|
|
'sent_at' => 'datetime',
|
|
];
|
|
|
|
protected static function booted(): void
|
|
{ }
|
|
|
|
public function business()
|
|
{
|
|
return $this->belongsTo(Business::class);
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|