You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
659 B
33 lines
659 B
<?php
|
|
|
|
use App\Livewire\Concerns\WithModal;
|
|
use App\Livewire\Concerns\WithToast;
|
|
use Livewire\Attributes\Locked;
|
|
use Livewire\Component;
|
|
|
|
new class extends Component
|
|
{
|
|
use WithModal;
|
|
use WithToast;
|
|
|
|
#[Locked]
|
|
public ?string $id = null;
|
|
|
|
#[Locked]
|
|
public string $mode = 'create';
|
|
|
|
protected string $resourceName = '{{ modelVariable }}';
|
|
|
|
public function show(int|string $id): void
|
|
{
|
|
$this->id = $id;
|
|
$this->mode = 'update';
|
|
// $this->form->fill($this->model->only(['name']));
|
|
}
|
|
|
|
public function hide(): void
|
|
{
|
|
// $this->form->reset();
|
|
$this->reset('id', 'mode');
|
|
}
|
|
};
|
|
|