Home › Forums › General discussion › How Do You Structure a Headless Laravel App for Clean Separation of Concerns?
- AuthorPosts
Hey Laravel devs!
I’ve recently been diving into <b>Headless Laravel</b> setups where Laravel acts strictly as an <b>API backend</b>, and the frontend is decoupled (e.g., built with React, Vue, or even Next.js). I’m looking to get some input and share thoughts on how to best <b>structure a Headless Laravel app</b> for <b>clean separation of concerns</b>.
Here’s the ideal structure I’ve been working with:
app/
├── Http/
│ ├── Controllers/Api/ # API controllers only
│ └── Middleware/
├── Services/ # Business logic (non-framework specific)
├── Repositories/ # Data access layer
├── Models/
├── Events/Listeners/
├── Jobs/
routes/
├── api.php # API-only routes
<h2>What Do You Think?</h2>- <li data-xf-list-type=”ul”>How do <i>you</i> structure your Headless Laravel APIs?
<li data-xf-list-type=”ul”>Do you use any other patterns like Domain-Driven Design or Hexagonal Architecture?
<li data-xf-list-type=”ul”>Any tooling recommendations for testing, caching, or debugging APIs?Looking forward to your thoughts!
Contact Us-
Webkul Software Pvt. Ltd.
H-28, Sector 63, Noida, India
1202 North Market Street, suite-111, Wilmington, Delaware
Ph no- (+91)-9870284067,(+1)-9143531684
Email- sales@webkul.com
- AuthorPosts
- You must be logged in to reply to this topic.