Role.php 455 Bytes
Newer Older
Siti Aisah committed
1 2 3 4 5 6
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
7
use App\Traits\Uuid;
Siti Aisah committed
8 9 10

class Role extends Model
{
11 12 13
    use HasFactory;
    use Uuid;

Siti Aisah committed
14
    public $incrementing = false;
15 16
    protected $keyType = 'uuid';

Siti Aisah committed
17 18
    protected $table = 'role';

19
    protected $fillable = ['nama'];
Triyah Fatmawati committed
20

Siti Aisah committed
21 22
    public function rUser()
    {
Triyah Fatmawati committed
23
        return $this->belongsToMany(Users::class, 'idrole', 'id');
Siti Aisah committed
24 25
    }
}