PHPackages                             mehul/laravel-enterprise-structure - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. mehul/laravel-enterprise-structure

ActiveLibrary[Framework](/categories/framework)

mehul/laravel-enterprise-structure
==================================

Opinionated, optional project structure for long-term Laravel applications

v1.1.0(4mo ago)45MITPHPPHP ^8.1

Since Feb 9Pushed 4mo agoCompare

[ Source](https://github.com/mehulkoradiya/laravel-enterprise-structure)[ Packagist](https://packagist.org/packages/mehul/laravel-enterprise-structure)[ RSS](/packages/mehul-laravel-enterprise-structure/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Laravel Enterprise Structure
============================

[](#laravel-enterprise-structure)

Opinionated but optional project structure for long-term Laravel applications.

This package provides generators and conventions that guide teams toward maintainable, scalable architecture without modifying Laravel core behavior.

---

Installation
------------

[](#installation)

Install via Composer:

```
composer require mehul/laravel-enterprise-structure
```

Publish the configuration:

```
php artisan vendor:publish --tag=enterprise-structure-config
```

Install the directory structure:

```
php artisan enterprise:install
```

This creates the recommended folder structure in your Laravel application.

---

Commands
--------

[](#commands)

### Create a Domain

[](#create-a-domain)

Generate a new domain with standard structure:

```
php artisan make:domain User
```

Creates the domain directory and associated files under `app/Domains/User/`.

### Create an Action

[](#create-an-action)

Generate a reusable action for business logic:

```
php artisan make:action User/CreateUser
```

Actions contain atomic, single-responsibility operations.

### Create a Use Case

[](#create-a-use-case)

Generate a use case that orchestrates multiple actions:

```
php artisan make:usecase User/RegisterUser
```

Use cases bind together actions to achieve specific user workflows.

---

Project Structure
-----------------

[](#project-structure)

```
app/
├── Domains/                 # Business logic isolated by domain
│   └── User/
│       ├── Actions/
│       ├── Models/
│       └── Repositories/
├── Application/             # Application-specific logic
│   └── UseCases/
├── Http/                    # Controllers stay thin
│   └── Controllers/
└── Providers/

```

---

Philosophy
----------

[](#philosophy)

🎯 **Laravel remains untouched** — No core modifications, only additions

🏗️ **Architecture is optional** — Use what you need, ignore what you don't

🎭 **Controllers stay thin** — They route and respond, nothing more

🔒 **Domain logic stays isolated** — Business rules live in domains, not controllers

🧩 **Actions are reusable** — Share logic across controllers, commands, and jobs

---

When NOT to Use This
--------------------

[](#when-not-to-use-this)

- **Small prototypes** — Overkill for proof-of-concepts
- **Single-developer throwaway apps** — Simple CRUD needs simpler structure
- **Short-lived projects** — Architecture pays off over years, not weeks

---

Configuration
-------------

[](#configuration)

Customize paths and namespaces in `config/enterprise-structure.php`:

```
return [
    'paths' => [
        'domains' => app_path('Domains'),
        'application' => app_path('Application'),
    ],

    'namespaces' => [
        'domains' => 'App\\Domains',
        'application' => 'App\\Application',
    ],
];
```

---

Testing
-------

[](#testing)

Run tests with Pest:

```
npm run test
```

Run specific test file:

```
php artisan pest tests/Feature/MakeDomainTest.php
```

---

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10.0+

---

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

---

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit pull requests with clear descriptions of changes.

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for version history.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance75

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

2

Last Release

139d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/40424761?v=4)[Mehul Koradiya](/maintainers/mehulkoradiya)[@mehulkoradiya](https://github.com/mehulkoradiya)

---

Top Contributors

[![mehulkoradiya](https://avatars.githubusercontent.com/u/40424761?v=4)](https://github.com/mehulkoradiya "mehulkoradiya (6 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/mehul-laravel-enterprise-structure/health.svg)

```
[![Health](https://phpackages.com/badges/mehul-laravel-enterprise-structure/health.svg)](https://phpackages.com/packages/mehul-laravel-enterprise-structure)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M299](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
