<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class UserSetting extends Model
{
    protected $fillable = [
        'user_id',
        'news_notif',
        'promo_notif',
        'report_notif',
        'email_notif',
        'browser_notif',
    ];

    protected $casts = [
        'news_notif'     => 'boolean',
        'promo_notif'    => 'boolean',
        'report_notif'   => 'boolean',
        'email_notif'    => 'boolean',
        'browser_notif'  => 'boolean',
    ];

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}