validate(); $color = new ColorModel(); $color->name = $this->name; $color->hex = $this->hex; $color->save(); session()->flash('status', 'Color successfully created.'); // Clear the form $this->reset(['name', 'hex']); // Close the modal $this->createModal = false; } public function delete(Color $color) { @Auth::check(); $color->delete(); } public function render() { return view('livewire.filament.color', [ 'colors' => ColorModel::search('name', $this->search)->paginate(10) ]); } }