- Added DTOs (`AssignUsersToRoleData`, `RoleUserData`, `UserSelectData`) for user-role operations and UI data mapping. - Updated `RoleService` and `AppRoleService` with methods for user-role assignment, detachment, retrieval, and search. - Enhanced Blade views and Livewire components to support user-role management in "Roles and Apps." - Adjusted `Role`, `User`, and related models to incorporate Spatie roles and permissions support. - Improved UI with search and selection capabilities for assigning users to roles.
20 lines
362 B
PHP
20 lines
362 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Data\Role;
|
|
|
|
use Spatie\LaravelData\Data;
|
|
|
|
/**
|
|
* Lightweight DTO for populating the user search/select dropdown.
|
|
* Only carries the fields the UI choices component needs.
|
|
*/
|
|
final class UserSelectData extends Data
|
|
{
|
|
public function __construct(
|
|
public int $id,
|
|
public string $name,
|
|
) {}
|
|
}
|