This repository is a curated list of general recommendations on how to use Laravel Livewire framework to meet enterprise concerns regarding the security, performance, and maintenance of Livewire components. Avoid passing objects to the component's public properties if possible. Use primitive types: strings, integers, arrays, etc. That's because Livewire serializes/deserializes your component's payload with each request to the server to share the state between the frontend & backend. If you need to work on objects, you can create them inside a method or computed property, and then return the result of the processing.

Features

  • Any instance as large as the Eloquent model is big enough already for Livewire to slow down the component lifecycle
  • Keep component nesting level at 1
  • Utilize the form objects
  • Prefer to use event listeners over polling
  • Use computed properties to access the database
  • Use Route Model Binding to fetch the model
  • Use Artisan commands to create, move, and rename components
  • Always use loading states for better UX
  • Use lazy loading
  • Use Form Request rules for validation

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

Follow Livewire Best Practices

Livewire Best Practices Web Site

Other Useful Business Software
Skillfully - The future of skills based hiring Icon
Skillfully - The future of skills based hiring

Realistic Workplace Simulations that Show Applicant Skills in Action

Skillfully transforms hiring through AI-powered skill simulations that show you how candidates actually perform before you hire them. Our platform helps companies cut through AI-generated resumes and rehearsed interviews by validating real capabilities in action. Through dynamic job specific simulations and skill-based assessments, companies like Bloomberg and McKinsey have cut screening time by 50% while dramatically improving hire quality.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Livewire Best Practices!

Additional Project Details

Registered

2024-04-25