singleloginsystem/app/Models/RestrictedUserPermission.php
= 07d1b235cc Feat: add user access management components
- Added `RestrictedUserPermission` migration and model for managing user-role-permission restrictions.
- Introduced `UserService`, `RoleService`, and related DTOs for handling user access, role assignments, and permission restrictions.
- Created new Livewire components and Blade views for user management, including role/permission assignment modals.
- Updated navigation and routing to include the "Users" section under "Access Manager."
- Enhanced `RoleService` with methods for retrieving permissions and managing role-user interactions.
- Improved UI with permission toggles and streamlined selection features for better user-role management.
2026-05-20 13:07:28 +00:00

40 lines
842 B
PHP

<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Relations\{BelongsTo, Pivot};
use Spatie\Permission\Models\Permission;
#[Fillable(['user_id', 'role_id', 'permission_id'])]
class RestrictedUserPermission extends Pivot
{
protected $table = 'restricted_user_permissions';
/**
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @return BelongsTo<Role, $this>
*/
public function role(): BelongsTo
{
return $this->belongsTo(Role::class);
}
/**
* @return BelongsTo<Permission, $this>
*/
public function permission(): BelongsTo
{
return $this->belongsTo(Permission::class);
}
}