gps_system/app/Models/NotificationPreference.php
sackey 6b878bb0a0
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
Initial commit
2025-09-12 16:19:56 +00:00

44 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class NotificationPreference extends Model
{
use HasFactory;
protected $fillable = [
'user_id',
'email_notifications',
'sms_notifications',
'push_notifications',
'geofence_alerts',
'overspeed_alerts',
'offline_alerts',
'sos_alerts',
'maintenance_alerts',
];
protected $casts = [
'email_notifications' => 'boolean',
'sms_notifications' => 'boolean',
'push_notifications' => 'boolean',
'geofence_alerts' => 'boolean',
'overspeed_alerts' => 'boolean',
'offline_alerts' => 'boolean',
'sos_alerts' => 'boolean',
'maintenance_alerts' => 'boolean',
];
/**
* Get the user that owns these preferences
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}