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, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기