PHPackages                             quatrebarbes/larchiclass - 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. [Database &amp; ORM](/categories/database)
4. /
5. quatrebarbes/larchiclass

ActiveLibrary[Database &amp; ORM](/categories/database)

quatrebarbes/larchiclass
========================

Some architecture-related commands for Laravel developers

v1.0.5(2mo ago)0279↑60%MITPHPPHP ^8.1

Since Apr 1Pushed 2mo agoCompare

[ Source](https://github.com/quatrebarbes/larchiclass)[ Packagist](https://packagist.org/packages/quatrebarbes/larchiclass)[ Docs](https://github.com/quatrebarbes/larchiclass)[ RSS](/packages/quatrebarbes-larchiclass/feed)WikiDiscussions main Synced 4w ago

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

LarchiClass 😎
=============

[](#larchiclass-)

Some architecture-related commands for Laravel developers

**PHP 8.1+** · **Laravel 10 / 11** · install as `--dev`

Generate PlantUML class diagrams from your Laravel namespaces.

LarchiClass inspects your PHP classes produces a `.puml` file ready to render with PlantUML. The `larchi:class` command covers all PHP types (classes, interfaces, traits, enums), while `larchi:model` enriches the diagram with Eloquent properties and model relationships.

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

[](#installation)

```
composer require quatrebarbes/larchiclass --dev
```

Commands
--------

[](#commands)

CommandDescription`larchi:caller`Analyze all the function callers leading to a method &amp; shdescribe the flow into a diagram.`larchi:class`General-purpose diagram — classes, interfaces, traits, enums. Dependencies resolved from type hints.`larchi:model`Eloquent diagram — `$fillable`, `$casts`, `$hidden` properties and relationships (`hasMany`, `belongsTo`, `morphTo`…).### Examples of using `larchi:caller`

[](#examples-of-using-larchicaller)

```
# Default output: larchi-caller.puml
php artisan larchi:class "App\Domain\Billing::readInvoice"

# Custom output file
php artisan larchi:class "App\Domain\Billing::readInvoice" --output="docs/billing-read-invoice.puml"
```

### Examples of using `larchi:class`

[](#examples-of-using-larchiclass)

```
# Default namespace (App), output: larchi-class.puml
php artisan larchi:class

# Custom namespace
php artisan larchi:class --namespace="App\Domain\Billing"

# Custom output file
php artisan larchi:class --output="docs/billing.puml"

# Include parents and dependencies outside the namespace
php artisan larchi:class --namespace="App\Http\Controllers" --with-related

# Include everything, vendor classes included
php artisan larchi:class --with-related --with-vendors
```

### Example of using `larchi:model`

[](#example-of-using-larchimodel)

```
# Default namespace (App\Models), output: larchi-model.puml
php artisan larchi:model

# Specific subdomain
php artisan larchi:model --namespace="App\Models\Billing" --output="docs/billing-models.puml"

# Include Eloquent parent classes
php artisan larchi:model --with-related --with-vendors
```

> The `.puml` file can be rendered with [PlantUML](https://plantuml.com/), the VS Code PlantUML extension, or any compatible tool. The diagram is left-to-right by default.

What the diagram includes
-------------------------

[](#what-the-diagram-includes)

### `larchi:caller`

[](#larchicaller)

- All functions/methods that call the target method directly or not
- The complete chain of callers up to http routes &amp; artisan commands

### `larchi:class`

[](#larchiclass)

- All classes, interfaces, traits, and enums in the target namespace
- Properties with type, visibility (`+` `#` `-`), and `{static}` modifier
- Methods with visibility, `{abstract}`, and `{static}` modifiers
- Inheritance arrows (`
