Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

schmuerzu's avatar

Suitable Software Architecture for Laravel-Livewire Projects

What are the recommended software architecture approaches and best practices for developing a web application with Laravel and Livewire to ensure scalability, maintainability, and clean separation of concerns?

I have Eloquent models for data access, business logic encapsulated in Service classes, and Livewire components that instantiate these services and call their methods while handling UI rendering and user interactions.

but i dont know if this is the right way to do it

2 likes
6 replies
jlrdw's avatar

You could start with some of the lessons right here on laracast.

There is a whole series just on livewire.

As far as scalability services like digital ocean makes it easy to scale when needed. They also have all kinds of how to articles.

Edit:

Just stick with MVC and Laravel conventions. I have never used any of those patterns except the KISS principle. https://en.wikipedia.org/wiki/KISS_principle

1 like
schmuerzu's avatar

@jlrdw

I also thought about MVC but dont the livewire components just make controllers obsolvent?

1 like
vincent15000's avatar

@schmuerzu With Livewire, each component has its own environment and is isolated from the others.

You still have an MVC architecture, because you have the models to communicate with the database, you have the view, and you have the controller to handle the components working logic.

And you still can use external classes to handle the business logic.

So not so far from MVC.

1 like
vincent15000's avatar

I have developed a entire application with Livewire.

As @jlrdw said, KISS.

There is no need to have a particular architecture.

Pattern are only useful if you need some specific business logic.

I rarely use patterns.

1 like
JussiMannisto's avatar

Your approach sounds ok. Just stick to the standard structure, at least at the start.

If the project grows really big and managing it becomes a pain, you can try to refactor it into modules, but it may not be necessary. I have some big projects (500+ routes) that still use the default Laravel structure. Namespacing together with consistent path and naming conventions for resources go a long way.

I'm not a fan of doing many DB queries from UI components. You might consider moving some of them into the controller, then passing the results down to the views. I find it more transparent and easier to debug.

1 like
websitedesignerskenya's avatar

For Laravel + Livewire apps, keep it simple but structured:

Layer your code → Domain (rules), Application (use cases/services), Infrastructure (Eloquent, mail, APIs), Presentation (Livewire/UI).

Keep Livewire thin → only handle UI state, validation, and call services — no business logic inside components.

Use DTOs/Actions for commands instead of stuffing logic into controllers/models.

Repositories/Queries abstract persistence for cleaner separation.

Queue jobs & events for slow tasks (emails, payments, reports).

Test at multiple levels (unit for domain, feature for Livewire).

Follow Laravel best practices → policies for auth, caching for performance, queues for scaling.

👉 In short: push logic out of Livewire into dedicated layers, keep modules cohesive, and rely on Laravel’s queues, caching, and policies to scale cleanly.

2 likes

Please or to participate in this conversation.