- Added `mary.php` configuration file for customizable component and route prefixes. - Upgraded `livewire/livewire` to v4.3 and added `robsontenorio/mary` v2.8 for maryUI support. - Updated `ConnectedApps` component to fetch data dynamically via `ConnectedAppService`. - Replaced static services with computed properties and streamlined data mappings in templates. - Enhanced frontend styling with `daisyUI` and TailwindCSS v4.3 integration. - Improved user feedback in `ConnectedAppForm` with success/error toasts.
32 lines
820 B
PHP
32 lines
820 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Data\Ui\ConnectedApps;
|
|
|
|
use App\Enums\{ConnectionProtocolEnum, ConnectionStatusEnum};
|
|
use App\Models\ConnectedApp;
|
|
use Spatie\LaravelData\Data;
|
|
|
|
final class ConnectedAppData extends Data
|
|
{
|
|
public function __construct(
|
|
public int $id,
|
|
public string $name,
|
|
public ConnectionProtocolEnum $protocol,
|
|
public ?string $provider,
|
|
public ConnectionStatusEnum $status,
|
|
) {}
|
|
|
|
public static function fromModel(ConnectedApp $app): self
|
|
{
|
|
return new self(
|
|
id: $app->id,
|
|
name: $app->name,
|
|
protocol: ConnectionProtocolEnum::tryFrom($app->protocol->name),
|
|
provider: $app->provider?->name,
|
|
status: ConnectionStatusEnum::tryFrom($app->status->name)
|
|
);
|
|
}
|
|
}
|