<?php

namespace App;

use App\Traits\ModelTimeFormat;
use Illuminate\Database\Eloquent\Model;
use App\Traits\ModelLogChanging;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Configuration extends Model
{
    use ModelLogChanging;
    use ModelTimeFormat;
    protected $fillable = [
        'name','value','description','operator'
    ];

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

    public function scopeFilter($query,$filter)
    {
        return $filter->apply($query);
    }
}
