- Added `ConnectedAppData` DTO for structured data representation. - Implemented Livewire components for ConnectedApp list (`index`) and edit (`edit`). - Integrated `ConnectedAppService` with CRUD operations. - Updated routing to include ConnectedApp management paths. - Enhanced UI with reusable components and dynamic dropdowns for protocols, providers, and statuses.
45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Livewire\Forms;
|
|
|
|
use App\Data\ConnectedApp\ConnectedAppData;
|
|
use App\Services\ConnectedAppService;
|
|
use Livewire\Attributes\Validate;
|
|
use Livewire\Form;
|
|
|
|
class StoreConnectedAppFrom extends Form
|
|
{
|
|
#[Validate('required|string|max:255|min:3')]
|
|
public string $name = '';
|
|
|
|
#[Validate('required|numeric|min:1|exists:connection_providers,id')]
|
|
public int $providerId = 0;
|
|
|
|
#[Validate('required|numeric|min:1|exists:connection_protocols,id')]
|
|
public int $protocolId = 0;
|
|
|
|
#[Validate('required|numeric|min:1|exists:connection_statuses,id')]
|
|
public int $statusId = 0;
|
|
|
|
protected ConnectedAppService $service;
|
|
|
|
public function boot(ConnectedAppService $service): void
|
|
{
|
|
$this->service = $service;
|
|
}
|
|
|
|
/**
|
|
* This sets the form to edit mode, after fetching the connected app of
|
|
* the given id.
|
|
*/
|
|
public function set(ConnectedAppData $data): void
|
|
{
|
|
$this->name = $data->name;
|
|
$this->protocolId = $data->protocolId;
|
|
$this->providerId = $data->providerId;
|
|
$this->statusId = $data->statusId;
|
|
}
|
|
}
|