PHPackages                             faran/pulsar - 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. [Admin Panels](/categories/admin)
4. /
5. faran/pulsar

ActiveLibrary[Admin Panels](/categories/admin)

faran/pulsar
============

An opinionated Laravel architecture for building modular, domain-driven applications at scale

v0.1.5(1mo ago)117MITPHPPHP ^8.2

Since Feb 4Pushed 1mo agoCompare

[ Source](https://github.com/FaranAli9/laravel-pulsar)[ Packagist](https://packagist.org/packages/faran/pulsar)[ Docs](https://github.com/faran/pulsar)[ RSS](/packages/faran-pulsar/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

Pulsar
======

[](#pulsar)

> An opinionated Laravel architecture for building modular, domain-driven applications at scale.

**Pulsar is an opinionated architecture tool.** It provides a strict and explicit approach to organizing Laravel applications using clean architecture, domain-driven design, and service-oriented patterns. This architecture works well for medium-to-large scale applications, multi-tenant SaaS platforms, and teams that benefit from enforced boundaries between business logic and delivery mechanisms. If you prefer Laravel's default structure or flexible, ad-hoc patterns, Pulsar may not be the right fit.

This README is intentionally **concise**. It defines the **architectural contract**, not a tutorial.

---

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Architecture Overview](#architecture-overview)
- [Architecture Rules](#architecture-rules)
- [File Types](#file-types)
- [Commands Reference](#commands-reference)
- [Complete Example](#complete-example)
- [Contributing](#contributing)

---

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

[](#installation)

```
composer require faran/pulsar --dev
```

Generate your first service:

```
pulsar make:service Admin
```

---

Architecture Overview
---------------------

[](#architecture-overview)

Pulsar organizes your Laravel application into **two complementary layers**.

- **Service Layer** — delivery and orchestration
- **Domain Layer** — business logic

---

### Service Layer

[](#service-layer)

**Purpose:** HTTP delivery and application orchestration, scoped by consumer audience (Admin, Client, Internal).

```
app/Services/{Service}/
├── Providers/
│   ├── {Service}ServiceProvider.php
│   └── RouteServiceProvider.php
├── Routes/
│   └── api.php
└── Modules/{Module}/
    ├── Controllers/
    ├── Requests/
    ├── UseCases/
    └── Operations/

```

**A Service is:**

- A delivery boundary (Admin API, Client API)
- Scoped to a consumer audience
- A logical separation inside a single Laravel application

**A Service is NOT:**

- A microservice
- A bounded context
- A deployment unit
- An isolated database or schema

Services may share the same database, Domain layer, and deployment.

---

### Domain Layer

[](#domain-layer)

**Purpose:** Business logic independent of delivery concerns (HTTP, controllers).

```
app/Domain/{Domain}/
├── Models/
├── Actions/
├── DTOs/
├── Policies/
├── Events/
├── Enums/
├── Exceptions/
└── Queries/

```

The Domain layer is **Laravel-first**:

- Uses Eloquent models
- Uses Laravel events
- Uses Laravel authorization
- Has zero dependency on Services

It is independent of HTTP, **not** independent of Laravel.

---

Architecture Rules
------------------

[](#architecture-rules)

### Shared Vocabulary

[](#shared-vocabulary)

TermMeaning**Service**Delivery boundary for a consumer audience**Module**Feature slice within a Service**Domain**Business capability (Order, Catalog)**UseCase**Application workflow**Operation**Reusable workflow fragment for UseCases**Action**Atomic domain operation---

### Service Layer Call Graph

[](#service-layer-call-graph)

Controllers call **UseCases** only. Only **UseCases** call Operations. Multiple UseCases may call the same Operation.

---

### Operations

[](#operations)

Operations are reusable workflow fragments shared across UseCases. They may include sequencing and conditional branching decisions. They must never own transactions or emit domain events.

### Cross-Domain Logic

[](#cross-domain-logic)

Cross-domain coordination belongs in **UseCases**, never in Actions.

---

### Transactions

[](#transactions)

**UseCases own all transaction boundaries.**

Actions and Operations must never manage transactions.

---

### Return Types

[](#return-types)

Actions and Queries may return domain models, collections, primitives, or void. They must never return HTTP or framework response objects.

---

### Anti-Patterns

[](#anti-patterns)

- Fat Controllers containing business logic
- Controllers calling Operations directly
- Actions calling other Actions
- Operations emitting domain events
- Transactions inside Actions or Operations
- UseCases calling other UseCases

If you feel tempted to do any of the above, the architecture is being violated.

---

### Why Pulsar Exists

[](#why-pulsar-exists)

Pulsar optimizes for:

- Team-scale clarity
- Predictable code placement
- Easier PR reviews
- Safer refactors
- Fewer "where does this logic go?" debates

Flexibility is traded for consistency — deliberately.

---

File Types
----------

[](#file-types)

### Service Layer

[](#service-layer-1)

TypePurposeServiceBootstrap a delivery boundaryControllerHTTP handling onlyRequestValidation and authorizationUseCaseWorkflow orchestrationOperationReusable workflow fragment across UseCases (branching allowed; no transactions/events)### Domain Layer

[](#domain-layer-1)

TypePurposeModelDomain entity (Eloquent)ActionAtomic business operationDTOData transferEventDomain eventEnumDomain stateExceptionBusiness rule violationQueryRead-only domain query---

Commands Reference
------------------

[](#commands-reference)

### Service Layer

[](#service-layer-2)

- `make:service {name}`
- `make:controller {name} {module} {service} --resource`
- `make:request {name} {module} {service}`
- `make:use-case {name} {module} {service}`
- `make:operation {name} {module} {service}`

### Domain Layer

[](#domain-layer-2)

- `make:model {name} {domain}`
- `make:action {name} {domain}`
- `make:dto {name} {domain}`
- `make:policy {name} {domain}`
- `make:event {name} {domain}`
- `make:enum {name} {domain}`
- `make:exception {name} {domain}`
- `make:query {name} {domain}`

---

Complete Example
----------------

[](#complete-example)

See project documentation for a full end-to-end example covering Domain and Service layers.

---

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

[](#contributing)

Contributions are welcome. Please follow the architecture rules and existing conventions.

---

License
-------

[](#license)

MIT License.

---

Credits
-------

[](#credits)

Built with ❤️ by Faran Ali

Inspired by:

- Lucid Architecture
- Clean Architecture
- Domain-Driven Design

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance89

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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 ~9 days

Total

6

Last Release

55d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e16de83b75deeb80be290fce8d5746a81d217981c08cfb72bdf4df8a64b4dbb0?d=identicon)[FaranAli9](/maintainers/FaranAli9)

---

Top Contributors

[![FaranAli9](https://avatars.githubusercontent.com/u/7772571?v=4)](https://github.com/FaranAli9 "FaranAli9 (60 commits)")

---

Tags

phplaravellaravel 12scaffoldingcode generatorartisanarchitecturecrudDomain Driven Designenterprisedddservice layersaasmulti-tenantscalableclean architecturelaravel-architecturemodular-architecturevertical-slicelaravel-13medium-scale

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/faran-pulsar/health.svg)

```
[![Health](https://phpackages.com/badges/faran-pulsar/health.svg)](https://phpackages.com/packages/faran-pulsar)
```

###  Alternatives

[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1062.8k1](/packages/yorcreative-laravel-argonaut-dto)[inani/nova-resource-maker

A Laravel Nova package to help you generate resources fields

2513.7k](/packages/inani-nova-resource-maker)

PHPackages © 2026

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