<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Notification extends Model
{
    use HasFactory;

    protected $fillable = [
        'url',
        'type',
        'title_ar',
        'title_en',
        'user_id',
        'from_user_id',
        'message_ar',
        'message_en',
        'read',
        'photo',
        'modal_id'
    ];

    // get name translation
    public function getTitleAttribute()
    {
        return $this->attributes['title_' . app()->getLocale()];
    } // end getNameAttribute

    // get desc translation
    public function getMessageAttribute()
    {
        return $this->attributes['message_' . app()->getLocale()];
    } // end getDescAttribute

}
