Files
alrahma_sunday_school_api/app/Models/Preferences.php
T
2026-04-23 00:04:35 -04:00

54 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use App\Models\BaseModel;
class Preferences extends BaseModel
{
protected $table = 'user_preferences';
// ✅ CI: useTimestamps = true (created_at/updated_at)
public $timestamps = true;
protected $fillable = [
'user_id',
'receive_email_notifications',
'receive_sms_notifications',
'theme',
'language',
'timezone',
'style_color',
'menu_color',
'custom',
'menu_custom_bg',
'menu_custom_text',
'menu_custom_mode',
'receive_push_notifications',
'daily_summary_email',
'privacy_mode',
'marketing_emails',
'account_activity_alerts',
'created_at',
'updated_at',
];
protected $casts = [
'user_id' => 'integer',
'receive_email_notifications' => 'boolean',
'receive_sms_notifications' => 'boolean',
'receive_push_notifications' => 'boolean',
'daily_summary_email' => 'boolean',
'privacy_mode' => 'boolean',
'marketing_emails' => 'boolean',
'account_activity_alerts' => 'boolean',
];
/* Optional relationship */
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
}