PHPackages                             kaue-f/laravel-structura - 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. [Caching](/categories/caching)
4. /
5. kaue-f/laravel-structura

ActiveLibrary[Caching](/categories/caching)

kaue-f/laravel-structura
========================

Laravel-Structura is a tool designed to streamline and standardize the creation of resources in Laravel, promoting a more organized and scalable development structure.

v2.0.0(4mo ago)361MITPHPPHP ^8.2

Since Apr 14Pushed 4mo ago1 watchersCompare

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

READMEChangelog (8)Dependencies (3)Versions (10)Used By (0)

 English | [🇧🇷 Português](./docs/README_pt-BR.md)

Laravel Structura
=================

[](#laravel-structura)

> **Structura** comes from Latin and means structure and organization, reflecting the package’s purpose.

🌟 Introduction
--------------

[](#-introduction)

**Laravel Structura** is a Laravel package designed to simplify, standardize, and structure the creation of application resources, promoting a clean, scalable, and well-organized development environment.

Through custom Artisan commands, the package enables the automatic generation of classes such as `Actions`, `Cache`, `DTOs`, `Enums`, `Helpers`, `Services` and `Traits`, encouraging clear separation of responsibilities and solid architectural best practices.

The main goal of Structura is to reduce repetitive tasks, ensure structural consistency, and help developers keep Laravel projects well-organized as they grow.

✨ Features
----------

[](#-features)

- ✅ **Action** generation
- ✅ **Cache** generation
- ✅ **DTO** generation
- ✅ **Enum** generation
- ✅ **Helper** generation
- ✅ **Trait** generation
- ✅ **Service** generation
- ✅ Automatic namespace organization
- ✅ Consistent architectural patterns
- ✅ Centralized configuration via the `config/structura.php` file
- ✅ CLI options override default configuration

🛠 Requirements
--------------

[](#-requirements)

- PHP **^8.2**
- Laravel **^10.x | ^11.x | ^12.x**

📦 Installation
--------------

[](#-installation)

```
composer require kaue-f/laravel-structura
```

### ⚙️ Publishing the configuration file

[](#️-publishing-the-configuration-file)

```
php artisan structura:install
php artisan structura:install --force   # Force overwrite
```

This command creates a new `structura.php` file in the Laravel application's `config` directory.

📌 Available commands
--------------------

[](#-available-commands)

CommandDescription`structura:action`Create **Action** classes`structura:cache`Create **Cache** classes`structura:dto`Create **Data Transfer Object (DTO)** classes`structura:enum`Create **Enum** classes with helpers`structura:helper`Create **Helper** classes or global helpers`structura:service`Create **Service** classes`structura:trait`Create **Trait** classes`structura:install`Publish Structura configuration file### 📚 Usage examples

[](#-usage-examples)

#### Action

[](#action)

```
php artisan structura:action Logout
php artisan structura:action Logout --execute    # Default (-e)
php artisan structura:action Logout --handle     # (-l)
php artisan structura:action Logout --invokable  # (-i)
php artisan structura:action Logout --construct  # (-c)
php artisan structura:action Logout --raw        # (-r)
```

> Default method is execute(). Use --handle, --invokable, or --construct to change it. The --raw creates an Action without methods.

#### Cache

[](#cache)

```
php artisan structura:cache Classification
php artisan structura:cache Classification --extend   # (-e)
php artisan structura:cache Classification --raw      # (-r)
```

> Use --extend to extend Cache Support The --raw creates a standalone Cache class.

#### DTO

[](#dto)

```
php artisan structura:dto User
php artisan structura:dto User --no-final
php artisan structura:dto User --no-readonly
php artisan structura:dto User --no-construct
php artisan structura:dto User --trait        # (-t)
php artisan structura:dto User --raw          # (-r)
```

> Default is final readonly with \_\_construct. Use flags to disable. The --trait attaches InteractsWithDTO. The --raw creates a minimal DTO.

#### Enum

[](#enum)

```
php artisan structura:enum Status
php artisan structura:enum Status --backed=string
php artisan structura:enum Status --cases=ACTIVE,INACTIVE
php artisan structura:enum Status --label        # (-l)
php artisan structura:enum Status --trait        # (-t)
```

> Creates PHP native Enums, optionally backed, with labels or attached trait.

#### Helper

[](#helper)

```
php artisan structura:helper StringHelper
php artisan structura:helper StringHelper --example   # Default (-e)
php artisan structura:helper StringHelper --global    # (-g)
php artisan structura:helper --stub                   # (-s)
php artisan structura:helper StringHelper --raw       # (-r)
```

> The --example adds an example method to the helper (default behavior). The --raw creates a standalone helper without methods. The --stub generates a helpers.php file based on the package stub and does not require a helper name. Use --global to register global helper functions via Composer.

#### Service

[](#service)

```
php artisan structura:service Comment
php artisan structura:service Comment --construct   # Default (-c)
php artisan structura:service Comment --raw         # (-r)
```

> Services encapsulate business logic. Default includes \_\_construct. The --raw creates minimal class.

#### Trait

[](#trait)

```
php artisan structura:trait Loggable
```

> Traits are reusable behaviors for classes.

### 🧱 Example Structure

[](#-example-structure)

```
app/
├── Actions/
│   └── LogoutAction.php
│
├── Cache/
│   └── ClassificationCache.php
│
│
├── Concerns/
│   └── Loggable.php
│
├── DTOs/
│   └── UserDTO.php
│
├── Enums/
│   └── StatusEnum.php
│
├── Helpers/
│   ├── helpers.php
│   ├── StringHelper.php
│   └── string_helper.php
│
├── Services/
│   └── CommentService.php

```

📄 License
---------

[](#-license)

Released under the [MIT License](LICENSE.md).

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance78

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Recently: every ~7 days

Total

8

Last Release

121d ago

Major Versions

v1.5.0 → v2.0.02026-01-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/b81fee069303741e5d2a85243c0da8a250d165fc61f9dea8a43824d5eee49d01?d=identicon)[kaue-f](/maintainers/kaue-f)

---

Top Contributors

[![kaue-f](https://avatars.githubusercontent.com/u/90930907?v=4)](https://github.com/kaue-f "kaue-f (20 commits)")

---

Tags

laravellaravel-packagelivewirepackagephp-librarylaravelpackageartisancacheserviceactionstructura

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kaue-f-laravel-structura/health.svg)

```
[![Health](https://phpackages.com/badges/kaue-f-laravel-structura/health.svg)](https://phpackages.com/packages/kaue-f-laravel-structura)
```

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k10](/packages/dragon-code-laravel-cache)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

1317.7k](/packages/nexxai-laravel-cfcache)[henzeb/laravel-cache-index

Flexible replacement for tags

1213.9k](/packages/henzeb-laravel-cache-index)

PHPackages © 2026

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