singleloginsystem/app/Data/Role/RoleAppData.php
= c680c1ae6e Feat: implement role and app management
- Added services (`RoleService`, `AppRoleService`, `AppsPermissionService`) to handle role creation, app assignments, and permissions.
- Introduced new Livewire forms for creating roles and assigning apps (`CreateRoleForm`, `AssignAppToRoleForm`).
- Built dynamic Blade views for role and app management, including modals and reusable components.
- Removed outdated `fluxui-development` skill documentation.
2026-05-19 11:13:35 +00:00

32 lines
650 B
PHP

<?php
declare(strict_types=1);
namespace App\Data\Role;
use App\Models\ConnectedApp;
use Spatie\LaravelData\Data;
final class RoleAppData extends Data
{
public function __construct(
public int $id,
public int $appId,
public string $appName,
public int $duration,
) {}
/**
* Intercept the Eloquent model and map it to the DTO properties.
*/
public static function fromModel(ConnectedApp $app): self
{
return new self(
id: $app->pivot->id,
appId: $app->id,
appName: $app->name,
duration: $app->pivot->duration
);
}
}