- Added `ConnectionProviderData`, `NavItemData`, and `NavSubItemData` DTOs for structured data handling. - Implemented CRUD operations for `ConnectionProviderService`, including transaction-safe create, update, and delete methods. - Introduced Livewire components for ConnectionProvider list, edit, and create pages with dynamic and reusable UI elements. - Refactored routes to consolidate paths under the `apps` prefix and updated navigation to dynamically include new sections for providers. - Enhanced sidebar with structured submenu for ConnectionProviders and Settings using dynamic collections. - Updated existing Create and Edit templates to use consistent route naming and validation handling. - Replaced hardcoded navigation items with dynamically generated structures leveraging the `NavItemData` collection.
51 lines
1.5 KiB
PHP
51 lines
1.5 KiB
PHP
<?php
|
|
|
|
use App\Concerns\HandlesOperations;
|
|
use App\Data\ConnectedApp\StoreConnectionProviderRequestData;
|
|
use App\Livewire\Forms\StoreConnectionProviderForm;
|
|
use App\Services\ConnectionProviderService;
|
|
use Laravel\Mcp\Server\Attributes\Title;
|
|
use Livewire\Component;
|
|
|
|
new
|
|
#[Title('Create Connection Provider')]
|
|
class extends Component {
|
|
use HandlesOperations;
|
|
|
|
public StoreConnectionProviderForm $form;
|
|
protected ConnectionProviderService $service;
|
|
|
|
public function boot(ConnectionProviderService $service): void
|
|
{
|
|
$this->service = $service;
|
|
}
|
|
|
|
public function save(): void
|
|
{
|
|
$this->attempt(
|
|
action: function () {
|
|
$this->form->validate();
|
|
$data = new StoreConnectionProviderRequestData(
|
|
name: $this->form->name,
|
|
);
|
|
$this->service->create($data);
|
|
$this->form->reset();
|
|
$this->redirectRoute('apps.connectionProviders.index', navigate: true);
|
|
},
|
|
);
|
|
}
|
|
};
|
|
?>
|
|
|
|
<div>
|
|
<x-shared.card :title="__('Create Connection Provider')">
|
|
<x-mary-form :no-separator="true" class="p-4" wire:submit="save">
|
|
<x-mary-input wire:model.blur="form.name" :label="__('Name')"/>
|
|
<x-slot:actions>
|
|
<x-mary-button class="btn-primary" type="submit" spinner="save" wire:click="form.store"
|
|
:label="__('Save')"/>
|
|
</x-slot:actions>
|
|
</x-mary-form>
|
|
</x-shared.card>
|
|
</div>
|