<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Nivel extends Model
{
    use SoftDeletes;
    protected $table = 'nivel';

    protected $attributes = [
        'deleted_at' => '0000-00-00 00:00:00',
    ];

    public function getPirivilegios($id)
    {
        $privilegios = Privilegiosnivel::where('nivel', $this->id)
        ->where('privilegio',$id)
        ->first();

        if ($privilegios) {
            return true;
        }else {
            return false;
        }

        return false;
    }
}