芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Models/Role.php
str_slug($value), ); } public function permissions(): HasMany { return $this->hasMany(PermissionRole::class, 'role_id'); } public function rolePermissions(): BelongsToMany { return $this->belongsToMany(Permission::class, 'permission_role'); } public function roleuser(): HasMany { return $this->hasMany(RoleUser::class, 'role_id'); } public function users(): BelongsToMany { return $this->belongsToMany(User::class, 'role_user'); } public function permissionType($permissionId) { $permissionType = PermissionRole::where('role_id', $this->id)->where('permission_id', $permissionId)->first(); if ($permissionType) { return $permissionType->permission_type_id; } return false; } public function unsyncedUsers() { return $this->belongsToMany(User::class, 'role_user')->where('users.permission_sync', 0); } }