<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class UserUnit extends Model
{
    protected $table = 'user_unit';
    protected $fillable = ['unit_id','user_id','role_id'];


    public $timestamps = false;


    public function isAdmin()
    {
        return $this->admin;

    }
    public function user()
    {
        return $this->hasOne('App\User','user_id','id');
    }

    public function unit()
    {
        return $this->hasOne('App\Unit','id','unit_id');
    }

}
