- Introduced `HandlesOperations` trait for reusable error handling with toasts and logging. - Added `StoreConnectionProviderForm` Livewire component with validation and slug uniqueness check. - Implemented `StoreConnectionProviderRequestData` DTO for structured data handling. - Updated `ConnectionProviderService` to include `create()` method using database transactions. - Registered new routes for creating connection providers. - Enhanced `ConnectionProvider` model with `Fillable` attribute for `name` and `slug`.
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
use App\Concerns\HandlesOperations;
|
|
use App\Livewire\Forms\StoreConnectionProviderForm;
|
|
use Laravel\Mcp\Server\Attributes\Title;
|
|
use Livewire\Component;
|
|
use Mary\Traits\Toast;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
new
|
|
#[Title('Create Connection Provider')]
|
|
class extends Component {
|
|
use HandlesOperations;
|
|
|
|
public StoreConnectionProviderForm $form;
|
|
|
|
public function save(): void
|
|
{
|
|
$this->attempt(
|
|
action: function () {
|
|
$this->form->save();
|
|
$this->redirectRoute('dashboard', 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>
|