changed livewire component names

This commit is contained in:
2025-03-15 23:16:46 +01:00
parent 82b63aa682
commit 2e7f484eba
7 changed files with 30 additions and 31 deletions
-46
View File
@@ -1,46 +0,0 @@
<?php
namespace App\Livewire\Color;
use Livewire\WithPagination;
use Livewire\Attributes\Validate;
use Livewire\Component;
use Livewire\Attributes\title;
use Illuminate\Support\Facades\Auth;
use App\Models\Color;
#[title('Colors')]
class Index extends Component
{
use WithPagination;
#[Validate('required')]
public $name = '';
#[Validate('required')]
public $hex = '';
public function create() {
// Validate
$this->validate();
// Create the color
Color::create([
$this->all()
]);
// Clear the form
$this->reset(['name', 'hex']);
}
public function delete(Color $color) {
@Auth::check();
$color->delete();
}
public function render()
{
return view('livewire.color.index', [
'colors' => Color::paginate(10)
]);
}
}