PHPackages                             magedahmad/insular - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. magedahmad/insular

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

magedahmad/insular
==================

An architecture for scalable software.

1241[1 issues](https://github.com/MagedAhmad/insular/issues)PHP

Since Nov 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/MagedAhmad/insular)[ Packagist](https://packagist.org/packages/magedahmad/insular)[ RSS](/packages/magedahmad-insular/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Insular
=======

[](#insular)

Insular is a software architecture to build scalable Laravel projects in a modern, clear and modular way.

**Insular** is latin word which means "*Having a narrow view of the world.*" and that is how modules are suppose to be structured. 🔥🔥

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#Installation)
- [Snowflake](#snowflake)
- [Available commands](#available-commands)
- [Managing Modules](#modules)
- [Managing Features](#features)
- [Managing Operations](#operations)
- [Managing Jobs](#jobs)
- [Managing Controllers](#controllers)
- [Managing Migrations](#migrations)
- [Managing Models](#models)
- [Managing Resources](#resources)
- [Managing Requests](#requests)
- [Managing Types](#types)
- [Managing Exception](#exception)

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

[](#installation)

You can install the package via composer:

```
composer require MagedAhmad/insular
```

Snowflake
---------

[](#snowflake)

We use snowflake for ids, by default newly created models with the custom command will use the `Snowflake` trait. you can [read more about snowflake here](https://medium.com/m/global-identity?redirectUrl=https%3A%2F%2Fitnext.io%2Fhow-to-use-twitter-snowflake-ids-for-your-database-primary-keys-in-laravel-763a98e78466)

Available commands
------------------

[](#available-commands)

TargetCommandCreate new modulephp artisan create:module $nameCreate new featurephp artisan create:feature $name $moduleCreate new operationphp artisan create:operation $name $moduleCreate new jobphp artisan create:job $name $moduleCreate new controllerphp artisan create:controller $name $moduleCreate new migrationphp artisan create:migration $name $moduleCreate new modelphp artisan create:model $name $moduleCreate new typephp artisan create:type $name $moduleCreate new resourcephp artisan create:resource $name $moduleCreate new requestphp artisan create:request $name $moduleCreate new exceptionphp artisan create:exception $name $moduleModules
-------

[](#modules)

You start by building the main block in your application which is a `Module`.

Modules are like mini laravel applications where each module contains everything needed to build this module.

```
php artisan create:module $name
```

example:

```
php artisan create:module Auth
```

this will create module structure in `Modules\Auth`

Features
--------

[](#features)

Feature can be used when you have multiple operations related to some action and you would repeat these operations more than once, so you can create a feature and reuse it later on.

```
php artisan create:feature $name $module
```

example:

```
php artisan create:feature LoginUserFeature Auth
```

this will create feature in `Modules\Auth\Features\LoginUserFeature`

Operations
----------

[](#operations)

Operation is the main building block where most logic would go, it might contain multiple jobs.

```
php artisan create:operation $name $module
```

example:

```
php artisan create:operation LoginUserOperation Auth

```

this will create file in `Modules\Auth\Operations\LoginUserOperation`

Jobs
----

[](#jobs)

Jobs are the smallest unit on our system. you can use it to avoid duplication of small shrunks of code . you should only use it when you are sure that you would use it multiple times, otherwise operation should be just fine to hold the logic in it.

```
php artisan create:job $name $module
```

example:

```
php artisan create:job LoginUserJob Auth

```

this will create file in `Modules\Auth\Jobs\LoginUserJob`

Controllers
-----------

[](#controllers)

```
php artisan create:controller $name $module
```

example:

```
php artisan create:controller LoginController Auth

```

this will create file in `Modules\Auth\Http\Controllers\LoginController`

Migrations
----------

[](#migrations)

you only need to write the migration name like `users`, `products`, `categories`, no need to type `create_users_table` .

```
php artisan create:migration $name $module
```

example:

```
php artisan create:migration users Auth

```

this will create file in `Modules\Auth\database\migrations\users`

Models
------

[](#models)

Models use `snowflake` trait by default

```
php artisan create:model $name $module
```

example:

```
php artisan create:model User Auth

```

this will create file in `Modules\Auth\Models\User`

Resources
---------

[](#resources)

Resources can be used to map data before sending in the response .

```
php artisan create:resource $name $module
```

example:

```
php artisan create:resource UserResource Auth

```

this will create file in `Modules\Auth\Http\Controllers\Resource\UserResource`

Requests
--------

[](#requests)

can be used for validating incoming request data .

```
php artisan create:request $name $module
```

example:

```
php artisan create:request UserRequest Auth

```

this will create file in `Modules\Auth\Http\Controllers\Requests\UserRequest`

Types
-----

[](#types)

Types can be used for internal handling of data between classes

```
php artisan create:type $name $module
```

example:

```
php artisan create:type UserData Auth

```

this will create file in `Modules\Auth\Types\UserData`

Exception
---------

[](#exception)

```
php artisan create:exception $name $module
```

example:

```
php artisan create:exception UserNotFoundException Auth

```

this will create file in `Modules\Auth\Exceptions\UserNotFoundException`

### Testing

[](#testing)

```
vendor/bin/pest
```

### TODO

[](#todo)

1- Work on a global response for all requests. 2- Provide easy way to test/view apis. 3- Switch between Pest and phpunit

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Maged Ahmed](https://github.com/MagedAhmad)
- [Osama Kamel](https://github.com/0samaKamel)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![MagedAhmad](https://avatars.githubusercontent.com/u/12874132?v=4)](https://github.com/MagedAhmad "MagedAhmad (2 commits)")

### Embed Badge

![Health badge](/badges/magedahmad-insular/health.svg)

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

###  Alternatives

[vpietri/adm-quickdevbar

QuickDevBar is a developer toolbar for magento 2

577348.6k](/packages/vpietri-adm-quickdevbar)[minime/annotations

The KISS PHP annotations library

229378.6k36](/packages/minime-annotations)[data-uri/data-uri

PHP DataURI component

60627.5k4](/packages/data-uri-data-uri)[friendsoftypo3/frontend-editing

Enable editors to work with the content in the most intuitive way possible

110123.8k2](/packages/friendsoftypo3-frontend-editing)[rockettheme/toolbox

RocketTheme Toolbox Library

22526.9k3](/packages/rockettheme-toolbox)[holiday-jp/holiday_jp

Japanese holidays

20161.3k](/packages/holiday-jp-holiday-jp)

PHPackages © 2026

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