Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
datlechin authored and github-actions[bot] committed Nov 9, 2024
1 parent 73a77d7 commit 310191f
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions src/Livewire/CreateCustomText.php
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
<?php

declare(strict_types=1);

namespace Datlechin\FilamentMenuBuilder\Livewire;

use Datlechin\FilamentMenuBuilder\Models\Menu;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Illuminate\Contracts\View\View;
use Livewire\Component;

class CreateCustomText extends Component implements HasForms
{
use InteractsWithForms;

public Menu $menu;

public string $title = '';

public function save(): void
{
$this->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');
}
}
<?php

declare(strict_types=1);

namespace Datlechin\FilamentMenuBuilder\Livewire;

use Datlechin\FilamentMenuBuilder\Models\Menu;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Illuminate\Contracts\View\View;
use Livewire\Component;

class CreateCustomText extends Component implements HasForms
{
use InteractsWithForms;

public Menu $menu;

public string $title = '';

public function save(): void
{
$this->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');
}
}

0 comments on commit 310191f

Please sign in to comment.