PHPackages                             albaraa/aztec - 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. albaraa/aztec

ActiveLibrary[Framework](/categories/framework)

albaraa/aztec
=============

Automatic CRUD generator for Laravel modules

v1.1.1(4mo ago)014MITPHPPHP ^8.1

Since Feb 16Pushed 4mo agoCompare

[ Source](https://github.com/AlBaraa-AlShalabi/aztec)[ Packagist](https://packagist.org/packages/albaraa/aztec)[ RSS](/packages/albaraa-aztec/feed)WikiDiscussions main Synced today

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

Aztec - Advanced Layered CRUD Generator for Laravel
===================================================

[](#aztec---advanced-layered-crud-generator-for-laravel)

Introduction
------------

[](#introduction)

Aztec is a powerful Laravel package designed to automate the generation of a clean, layered architecture for your application modules. It goes beyond simple CRUD generation by implementing a robust Service-Repository pattern, ensuring your controllers remain thin and your business logic is well-encapsulated.

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

[](#installation)

You can install the package via composer:

```
composer require albaraa/aztec
```

Features
--------

[](#features)

- **Layered Architecture**: Generates Controller, Service, Repository (Interface &amp; Implementation), API Resource, and Form Requests.
- **Module Support**: Designed to work intimately with modular structures (e.g., `Modules/Blog`).
- **Interactive Generation**: CLI prompts guide you through selecting relationships for resources, adding custom filters, and configuring relation syncing.
- **Smart Validation**: Automatically builds validation rules and translation keys (e.g., `validations.module.field.rule`) based on your model's attributes and casts.
- **Automatic Wiring**: Automatically binds repositories in your Module's ServiceProvider and appends routes to `web.php`.

Usage
-----

[](#usage)

### Generating CRUD

[](#generating-crud)

The main entry point is the `aztec:make-crud` command. It requires the Module name and the Model name (which must already exist).

```
php artisan aztec:make-crud {Module} {Model}
```

**Example:**To generate CRUD for a `Post` model inside the `Blog` module:

```
php artisan aztec:make-crud Blog Post
```

### The Generation Flow

[](#the-generation-flow)

When you run the command, Aztec performs the following steps:

1. **Analysis**: It inspects your Model file to understand its fillable attributes, casts, and relationships.
2. **Interactive Configuration**:
    - **Resources**: It asks which relationships should be included in the API Resource.
    - **Service Layer**: It prompts you to add custom filters for the listing endpoint (e.g., filter by status, type, etc.) and asks which relationships should be synced automatically during create/update operations.
3. **File Generation**:
    - **Repository**: Generates `PostRepositoryInterface` and `EloquentPostRepository`. It checks `BlogServiceProvider` and binds the interface to the implementation automatically.
    - **Service**: Generates `PostService` containing business logic. It handles pagination, search (smartly guessing searchable fields), custom filtering, and transaction-wrapped CRUD operations.
    - **Requests**: Generates `PostStoreRequest` and `PostUpdateRequest` with rules inferred from your model. It also generates a `messages()` method returning code-based keys (e.g., `validations.blog.title.required`) for frontend localization.
    - **Controller**: Generates `PostController` which injects the `PostService`. It remains clean and acts only as a gateway.
    - **Resource**: Generates `PostResource` to format the JSON response.
    - **Routes**: Appends standard RESTful routes to `Modules/Blog/routes/web.php` with a clean group structure.

Directory Structure Idea
------------------------

[](#directory-structure-idea)

Assuming a `Blog` module and `Post` model, Aztec creates/updates:

```
Modules/Blog/
├── app/
│   ├── Http/
│   │   ├── Controllers/
│   │   │   └── PostController.php
│   │   ├── Requests/
│   │   │   ├── PostStoreRequest.php
│   │   │   └── PostUpdateRequest.php
│   │   ├── Resources/
│   │   │   └── PostResource.php
│   ├── Repositories/
│   │   ├── Interfaces/
│   │   │   └── PostRepositoryInterface.php
│   │   ├── EloquentPostRepository.php
│   ├── Services/
│   │   └── PostService.php
│   └── Providers/
│       └── BlogServiceProvider.php [Updated for Binding]
└── routes/
    └── web.php [Updated with Routes]

```

Customization
-------------

[](#customization)

You can customize the available layers and generation behavior by publishing the config file (if available):

```
php artisan vendor:publish --tag=aztec-config
```

---

*Crafted for developers who value clean code and speed.*

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance75

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

Total

3

Last Release

133d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e565dcfcef60d0708adf23af290d6f04f1f7795a32299ffbe593c5b8cd9940c6?d=identicon)[AlBaraa-AlShalabi](/maintainers/AlBaraa-AlShalabi)

---

Top Contributors

[![AlBaraa-AlShalabi](https://avatars.githubusercontent.com/u/184749717?v=4)](https://github.com/AlBaraa-AlShalabi "AlBaraa-AlShalabi (8 commits)")

### Embed Badge

![Health badge](/badges/albaraa-aztec/health.svg)

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[laravel/surveyor

Static analysis tool for Laravel applications.

86121.4k11](/packages/laravel-surveyor)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M150](/packages/laravel-mcp)[laravel/folio

Page based routing for Laravel.

603583.7k33](/packages/laravel-folio)

PHPackages © 2026

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