$permissions * @property-read int|null $permissions_count * @property-read \Illuminate\Database\Eloquent\Collection $users * @property-read int|null $users_count * @method static \Illuminate\Database\Eloquent\Builder|Role newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Role newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Role query() * @method static \Illuminate\Database\Eloquent\Builder|Role whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Role whereIdRole($value) * @method static \Illuminate\Database\Eloquent\Builder|Role whereNamaRole($value) * @method static \Illuminate\Database\Eloquent\Builder|Role whereUpdatedAt($value) * @mixin \Eloquent */ class Role extends Model { protected $table = 'roles'; protected $primaryKey = 'id_role'; protected $fillable = ['nama_role']; public function users(): BelongsToMany { return $this->belongsToMany(User::class, 'detail_user_roles', 'id_role', 'id_user'); } public function permissions(): BelongsToMany { return $this->belongsToMany(Permission::class, 'detail_role_permissions', 'id_role', 'id_permission'); } }