Laravel

Livewire & Inertia

Livewire components, wire:model, validation, Inertia.js setup, partial reloads, shared data, router, comparisons

20 питань зі співбесід·
Mid-Level
1

What is Livewire in the context of Laravel?

Відповідь

Livewire is a full-stack framework for Laravel that enables building dynamic and reactive user interfaces entirely in PHP, without needing to write much JavaScript. It automatically handles communication between server and client via AJAX requests, allowing creation of interactive components similar to modern JavaScript frameworks while staying within the PHP/Laravel ecosystem.

2

Which modifier to use with wire:model to trigger an update only when the user leaves an input field?

Відповідь

The .blur modifier triggers a Livewire update only when the user leaves the field (blur event), for example by clicking elsewhere or using the Tab key. This reduces network requests compared to .live which sends a request on every keystroke. It's useful for forms where real-time validation isn't necessary for each character typed.

3

What is the purpose of the #[Modelable] attribute in a Livewire child component?

Відповідь

The #[Modelable] attribute signals to Livewire that a child component property should be bidirectionally bound with the parent's wire:model. This allows extracting form fields into reusable components while maintaining state synchronization with the parent. Currently, only the first #[Modelable] attribute per component is supported.

4

Which Livewire directive allows displaying a visual indicator when a field has unsaved changes?

5

Which Livewire modifier allows delaying network requests by 250ms after the last user keystroke?

+17 питань зі співбесід

Опануй Laravel для наступної співбесіди

Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.

Почни безкоштовно