
Livewire & Inertia
Livewire components, wire:model, validation, Inertia.js setup, partial reloads, shared data, router, comparisons
1What is Livewire in the context of Laravel?
What is Livewire in the context of Laravel?
Câu trả lời
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.
2Which modifier to use with wire:model to trigger an update only when the user leaves an input field?
Which modifier to use with wire:model to trigger an update only when the user leaves an input field?
Câu trả lời
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.
3What is the purpose of the #[Modelable] attribute in a Livewire child component?
What is the purpose of the #[Modelable] attribute in a Livewire child component?
Câu trả lời
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.
Which Livewire directive allows displaying a visual indicator when a field has unsaved changes?
Which Livewire modifier allows delaying network requests by 250ms after the last user keystroke?
+17 câu hỏi phỏng vấn
Các chủ đề phỏng vấn Laravel khác
PHP Basics
PHP OOP Essentials
Composer & Autoloading
Laravel Fundamentals
Laravel Routing
Blade Templates
Request & Response
Eloquent ORM Basics
Eloquent Relationships
Migrations & Schema Builder
Validation & Forms
Authentication
Authorization & Policies
API Resources & Authentication
Middleware
Service Container & DI
Queues & Jobs
Events & Listeners
Notifications & Mail
File Storage
Testing & PHPUnit
Caching
Eloquent Advanced
Repository Pattern
Laravel Packages
Performance Optimization
Security Best Practices
Laravel Octane
Laravel Distributed Systems
Observability & Monitoring
Deployment & DevOps
Nắm vững Laravel cho lần phỏng vấn tiếp theo
Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.
Bắt đầu miễn phí