https://livewire.laravel.com is a fantastic package for creating interactive interfaces in a Laravel app. Using Livewire, you can write component classes that define interactive behavior.

We will work with a straightforward Livewire component to search for quotes in the database. Here's what that component could look like: namespace App\Http\Livewire; use App\Models\Quote; use Illuminate\Support\Collection; use Livewire\Component; class SearchComponent extends Component { public string $searchingFor = ''; public function render() { return view('livewire.search', [ 'quotes' => $this->getQuotes()]); } public function getQuotes(): Collection { if (empty($this->searchingFor)) { return collect(); } return Quote::search($this->searchingFor); }}

public function render() { ray($this->searchingFor); return view('livewire.search', [ 'quotes' => $this->getQuotes()]); }
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners