<?php

namespace App\Models\SettingManagement;

use App\Models\UserManagement\Customer;
use Illuminate\Database\Eloquent\Model;
use Nicolaslopezj\Searchable\SearchableTrait;

class Contact extends Model{

    use SearchableTrait;

    protected $table = "setting_mgt__contacts";
    protected $guarded = [];

    protected $searchable = [

        'columns' => [
            'contacts.name'     => 10,
            'contacts.email'    => 10,
            'contacts.mobile'   => 10,
            'contacts.title'    => 10,
            'contacts.message'  => 10,
        ],
    ];

    public function user(){
        return $this->belongsTo(Customer::class,'customer_id');
    }

    public function status(){
        return $this->active == 1 ? __('Lu') : __('Nouvea');
    }
}
