diff --git a/src/Livewire/CreateCustomText.php b/src/Livewire/CreateCustomText.php index 0bd9fee..1fe1349 100644 --- a/src/Livewire/CreateCustomText.php +++ b/src/Livewire/CreateCustomText.php @@ -1,60 +1,60 @@ -validate([ - 'title' => ['required', 'string'], - ]); - - $this->menu - ->menuItems() - ->create([ - 'title' => $this->title, - 'order' => $this->menu->menuItems->max('order') + 1, - ]); - - Notification::make() - ->title(__('filament-menu-builder::menu-builder.notifications.created.title')) - ->success() - ->send(); - - $this->reset('title'); - $this->dispatch('menu:created'); - } - - public function form(Form $form): Form - { - return $form - ->schema([ - TextInput::make('title') - ->label(__('filament-menu-builder::menu-builder.form.title')) - ->required(), - ]); - } - - public function render(): View - { - return view('filament-menu-builder::livewire.create-custom-text'); - } -} +validate([ + 'title' => ['required', 'string'], + ]); + + $this->menu + ->menuItems() + ->create([ + 'title' => $this->title, + 'order' => $this->menu->menuItems->max('order') + 1, + ]); + + Notification::make() + ->title(__('filament-menu-builder::menu-builder.notifications.created.title')) + ->success() + ->send(); + + $this->reset('title'); + $this->dispatch('menu:created'); + } + + public function form(Form $form): Form + { + return $form + ->schema([ + TextInput::make('title') + ->label(__('filament-menu-builder::menu-builder.form.title')) + ->required(), + ]); + } + + public function render(): View + { + return view('filament-menu-builder::livewire.create-custom-text'); + } +}