PHPackages                             structuraphp/structura-laravel - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. structuraphp/structura-laravel

ActiveLibrary[Testing &amp; Quality](/categories/testing)

structuraphp/structura-laravel
==============================

Laravel extension for Structura - Architectural testing stubs for Laravel applications

01PHP

Since May 24Pushed 2mo agoCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

Structura Laravel Extension
===========================

[](#structura-laravel-extension)

 [![Structura Logo](../docs/structura-logo.png)](../docs/structura-logo.png)

Laravel extension for [Structura](https://github.com/structuraphp/structura) — Install pre-configured architecture test stubs for your Laravel application.

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

[](#installation)

```
composer require --dev structuraphp/structura-laravel
```

The service provider is auto-discovered by Laravel.

Usage
-----

[](#usage)

### Initialize architecture tests

[](#initialize-architecture-tests)

```
php artisan structura:init
```

This command will:

1. Create the `structura.php` config file at the root of your project (if it doesn't exist)
2. Prompt a **multi-select** to choose which architecture test stubs to install
3. Generate the selected test files in `tests/Architecture/`

### Run Structura commands

[](#run-structura-commands)

The `structura` command is a pass-through to the native StructuraPHP CLI:

```
# Run architecture analysis (default)
php artisan structura

# Explicit analyze
php artisan structura analyze

# With options
php artisan structura analyze --test-suite=laravel --stop-on-failure

# Other commands
php artisan structura init
php artisan structura make:test
```

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

[](#configuration)

Publish the config file to customize paths and namespaces:

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

This creates `config/structura.php`:

```
return [
    // Output directory for generated test files
    'output_dir' => 'tests/Architecture',

    // Namespace for generated test classes
    'output_namespace' => 'Tests\\Architecture',

    // Source paths per category
    'paths' => [
        'controller'   => 'app/Http/Controllers',
        'dto'          => 'app/DataTransferObjects',
        'event'        => 'app/Events',
        'factory'      => 'database/factories',
        'form_request' => 'app/Http/Requests',
        'job'          => 'app/Jobs',
        'listener'     => 'app/Listeners',
        'mail'         => 'app/Mail',
        'middleware'    => 'app/Http/Middleware',
        'model'        => 'app/Models',
        'notification' => 'app/Notifications',
        'policy'       => 'app/Policies',
        'route'        => 'routes',
        'service'      => 'app/Services',
    ],
];
```

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

[](#requirements)

DependencyVersionPHP&gt;= 8.2Laravel11.x / 12.x / 13.xStructura&gt;= 0.7

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance58

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

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/5e895b534ebcc8bd54a08b36cad6507da36117a7146b88e62ad53fa45c96c362?d=identicon)[noelma](/maintainers/noelma)

---

Top Contributors

[![mathieu-noel](https://avatars.githubusercontent.com/u/200080698?v=4)](https://github.com/mathieu-noel "mathieu-noel (4 commits)")

### Embed Badge

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

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

PHPackages © 2026

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