reconstruction of the project

This commit is contained in:
root
2026-03-08 16:33:24 -04:00
parent 23b7db1107
commit c8de5f7edc
9157 changed files with 77877 additions and 1073823 deletions
+21 -7
View File
@@ -6,10 +6,11 @@ use App\Models\BaseModel;
class Preferences extends BaseModel
{
protected $table = 'user_preferences'; // Adjusted to match the table name
protected $primaryKey = 'id'; // Primary key of the table
protected $table = 'user_preferences';
// ✅ CI: useTimestamps = true (created_at/updated_at)
public $timestamps = true;
// Allowed fields to enable mass assignment
protected $fillable = [
'user_id',
'notification_email',
@@ -25,8 +26,21 @@ class Preferences extends BaseModel
'updated_at',
];
// Enable automatic timestamp management if needed
public $timestamps = true;
const CREATED_AT = 'created_at';
const UPDATED_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');
}
}