TenantAtlas/apps/platform/app/Support/Ui/EnterpriseDetail/PageActionData.php
ahmido ce0615a9c1 Spec 182: relocate Laravel platform to apps/platform (#213)
## Summary
- move the Laravel application into `apps/platform` and keep the repository root for orchestration, docs, and tooling
- update the local command model, Sail/Docker wiring, runtime paths, and ignore rules around the new platform location
- add relocation quickstart/contracts plus focused smoke coverage for bootstrap, command model, routes, and runtime behavior

## Validation
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/PlatformRelocation`
- integrated browser smoke validated `/up`, `/`, `/admin`, `/admin/choose-workspace`, and tenant route semantics for `200`, `403`, and `404`

## Remaining Rollout Checks
- validate Dokploy build context and working-directory assumptions against the new `apps/platform` layout
- confirm web, queue, and scheduler processes all start from the expected working directory in staging/production
- verify no legacy volume mounts or asset-publish paths still point at the old root-level `public/` or `storage/` locations

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #213
2026-04-08 08:40:47 +00:00

56 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Support\Ui\EnterpriseDetail;
final readonly class PageActionData
{
public function __construct(
public string $label,
public string $placement = 'header',
public ?string $url = null,
public ?string $actionName = null,
public bool $destructive = false,
public bool $requiresConfirmation = false,
public bool $visible = true,
public ?string $icon = null,
public bool $openInNewTab = false,
) {}
public function isRenderable(): bool
{
return $this->visible
&& trim($this->label) !== ''
&& (filled($this->url) || filled($this->actionName));
}
/**
* @return array{
* label: string,
* placement: string,
* url: ?string,
* actionName: ?string,
* destructive: bool,
* requiresConfirmation: bool,
* visible: bool,
* icon: ?string,
* openInNewTab: bool
* }
*/
public function toArray(): array
{
return [
'label' => $this->label,
'placement' => $this->placement,
'url' => $this->url,
'actionName' => $this->actionName,
'destructive' => $this->destructive,
'requiresConfirmation' => $this->requiresConfirmation,
'visible' => $this->visible,
'icon' => $this->icon,
'openInNewTab' => $this->openInNewTab,
];
}
}