PHPackages                             alxdorosenco/porto-for-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. [Templating &amp; Views](/categories/templating)
4. /
5. alxdorosenco/porto-for-laravel

ActiveLibrary[Templating &amp; Views](/categories/templating)

alxdorosenco/porto-for-laravel
==============================

This package is a solution for easy building and working with Porto pattern structure

v10.0.8(2y ago)55.4k↑27.7%MITPHPPHP ^8.1

Since Feb 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/alxdorosenco/porto-for-laravel)[ Packagist](https://packagist.org/packages/alxdorosenco/porto-for-laravel)[ Docs](https://github.com/alxdorosenco/porto-for-laravel)[ RSS](/packages/alxdorosenco-porto-for-laravel/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (87)Used By (0)

Porto for Laravel
=================

[](#porto-for-laravel)

### For Laravel \[9.x, 8.x, 7.x, 6.x, 5.8, 5.7, 5.6, 5.5\] please use the latest \[9.0, 8.0, 7.0, 6.0, 5.8, 5.7, 5.6, 5.5\] version.

[](#for-laravel-9x-8x-7x-6x-58-57-56-55-please-use-the-latest-90-80-70-60-58-57-56-55-version)

This is a package who gives flexible way to build a structure of the Porto (Software Architectural Pattern) in your Laravel project. You should no longer to migrate a lot of files and folders handle.

This package will do the job for you in some clicks.

- [Introduction](#Introduction)
- [How to install?](#HowToInstall?)
- [Ship structure](#ShipStructure)
- [Containers](#Containers)
    - [Standard](#Standard)
    - [Default](#Default)
    - [API](#API)
    - [CLI](#CLI)
    - [WEB](#WEB)
    - [Full](#Full)
- [Laravel console commands](#LaravelConsoleCommands)
    - [Make](#Make)
        - [make:cast](#makeCast)
        - [make:channel](#makeChannel)
        - [make:command](#makeCommand)
        - [make:component](#makeComponent)
        - [make:controller](#makeController)
        - [make:enum](#makeEnum)
        - [make:event](#makeEvent)
        - [make:exception](#makeException)
        - [make:factory](#makeFactory)
        - [make:job](#makeJob)
        - [make:listener](#makeListener)
        - [make:mail](#makeMail)
        - [make:middleware](#makeMiddleware)
        - [make:model](#makeModel)
        - [make:notification](#makeNotification)
        - [make:observer](#makeObserver)
        - [make:policy](#makePolicy)
        - [make:provider](#makeProvider)
        - [make:request](#makeRequest)
        - [make:resource](#makeResource)
        - [make:rule](#makeRule)
        - [make:scope](#makeScope)
        - [make:seeder](#makeSeeder)
        - [make:test](#makeTest)
    - [Model](#model)
        - [model:show](#modelShow)
- [Additional console commands](#AdditionalConsoleCommands)
    - [Make](#AdditionalMake)
        - [make:action](#makeAction)
        - [make:config](#makeConfig)
        - [make:contract](#makeContract)
        - [make:helper](#makeHelper)
        - [make:repository](#makeRepository)
        - [make:task](#makeTask)
        - [make:trait](#makeTrait)
        - [make:translation](#makeTranslation)
        - [make:value](#makeValue)

Introduction
============

[](#introduction)

Laravel is a popular and beautiful PHP framework who helps a lot to make your web applications. But web applications tend to grow and become harder to maintain and optimize. Unfortunately, Laravel, like other frameworks, does not have standard tools that allow you to write flexible, readable and easily maintainable code.

Porto (Software Architectural Pattern) is a brilliant solution for building large applications. This pattern helps you and your team to organize and maintain your code.

You can find more information about Porto by this link:

How to install?
===============

[](#how-to-install)

1. First of all you need to install the package:

    ```
    composer require alxdorosenco/porto-for-laravel

    ```
2. Next, you need to enable installed package in your .env file:

    ```
    PORTO_ENABLED=true

    ```
3. Next, you can install porto structure using this command:

    ```
    php artisan porto:install --container= --container-

    ```

    You need to put directory path when the Porto structure will be installed or you can confirm installation in the default app/ directory.

    Of course, if you put the custom directory path, you need to set it in the autoload -&gt; psr-4 in the composer.json file.

    You also can add directory name of your first container. For example:

    ```
    --container=

    ```

    This container will be installed in the Containers directory with standard structure. You also can force another container structures like:

    ```
    --container-default
    --container-api
    --container-cli
    --container-web
    --container-full

    ```
4. Next, you need to put some changes in the bootstrap/app.php file.

    From:

    ```
     $app->singleton(
         Illuminate\Contracts\Http\Kernel::class,
         App\Http\Kernel::class
     );

     $app->singleton(
         Illuminate\Contracts\Console\Kernel::class,
         App\Console\Kernel::class
     );

     $app->singleton(
         Illuminate\Contracts\Debug\ExceptionHandler::class,
         App\Exceptions\Handler::class
     );
    ```

    To:

    ```
     $app->singleton(
         Illuminate\Contracts\Http\Kernel::class,
         \Ship\Kernels\HttpKernel::class
     );

     $app->singleton(
         Illuminate\Contracts\Console\Kernel::class,
         \Ship\Kernels\ConsoleKernel::class
     );

     $app->singleton(
         Illuminate\Contracts\Debug\ExceptionHandler::class,
         \Ship\Exceptions\Handler::class
     );
    ```
5. At last, you need to comment or clear Application Service Providers in the file config/app.php. Because you don't need them. The package loads automatically all providers from Ship and Containers

    ```
    /*
    * Application Service Providers...
    */
    //App\Providers\AppServiceProvider::class,
    //App\Providers\AuthServiceProvider::class,
    // App\Providers\BroadcastServiceProvider::class,
    //App\Providers\EventServiceProvider::class,
    //App\Providers\RouteServiceProvider::class
    ```
6. That's all. Below you can find the skeleton structure of ship, each type of containers and information about adapted laravel console commands.

Ship structure
==============

[](#ship-structure)

This is a skeleton of the installed Ship structure.

```
Ship
    ├── Abstracts
    │   ├── Broadcasting
    │   │   ├── Channel.php
    │   │   ├── PresenceChannel.php
    │   │   └── PrivateChannel.php
    │   │── Commands
    │	│   └── ConsoleCommand.php
    │   ├── Components
    │	│   └── Component.php
    │   ├── Controllers
    │	│   └── Controller.php
    │   ├── Events
    │	│   └── Event.php
    │   ├── Exceptions
    │	│   └── Handler.php
    │   ├── Factories
    │	│   └── Factory.php
    │   ├── Jobs
    │	│   └── Job.php
    │   ├── Mails
    │	│   ├── Mailables
    │	│   │   ├── Content.php
    │	│   │   └── Envelope.php
    │	│   └── Mailable.php
    │   ├── Middleware
    │   │   ├── Authenticate.php
    │   │   ├── EncryptCookies.php
    │   │   ├── PreventRequestsDuringMaintenance.php
    │   │   ├── TrimStrings.php
    │   │   ├── TrustHosts.php
    │   │   ├── TrustProxies.php
    │   │   ├── ValidateSignature.php
    │   │   └── VerifyCsrfToken.php
    │   ├── Models
    │   │   ├── BaseModel.php
    │   │   ├── UserModel.php
    │   │   ├── Pivot.php
    │   │   ├── MorphPivot.php
    │   │   └── Builder.php
    │   ├── Notifications
    │	│   ├── Messages
    │	│   │   └── MailMessage.php
    │   │   └── Notification.php
    │   ├── Policies
    │	│   └── Policy.php
    │   ├── Providers
    │   │   ├── AuthServiceProvider.php
    │   │   ├── ServiceProvider.php
    │   │   ├── EventServiceProvider.php
    │   │   └── RouteServiceProvider.php
    │   ├── Requests
    │   │   ├── Request.php
    │   │   └── FormRequest.php
    │   ├── Responses
    │   │   ├── Response.php
    │   │   ├── RedirectResponse.php
    │   │   └── JsonResource.php
    │   ├── Resources
    │	│   └── ResourceCollection.php
    │   ├── Seeders
    │	│   └── Seeder.php
    │   ├── Tests
    │	│   └── PhpUnit
    │	│       └── TestCase.php
    │   ├── Translations
    │	│   └── PotentiallyTranslatedString.php
    │   └── Views
    │	    └── Component.php
    ├── Broadcasting
    │   ├── Channel.php
    │   ├── PresenceChannel.php
    │   └── PrivateChannel.php
    ├── Commands
    ├── Configs
    ├── Controllers
    │   └── Controller.php
    ├── Events
    │   └── Event.php
    ├── Exceptions
    │   └── Handler.php
    ├── Helpers
    │   └── helper.php
    ├── Kernels
    │   ├── ConsoleKernel.php
    │   └── HttpKernel.php
    ├── Mails
    │   └── Mailables
    │       ├── Envelope.php
    │       └── Content.php
    ├── Middleware
    │   ├── Authenticate.php
    │   ├── EncryptCookies.php
    │   ├── PreventRequestsDuringMaintenance.php
    │   ├── RedirectIfAuthenticated.php
    │   ├── TrimStrings.php
    │   ├── TrustHosts.php
    │   ├── TrustProxies.php
    │   ├── ValidateSignature.php
    │   └── VerifyCsrfToken.php
    ├── Migrations
    ├── Models
    │   ├── Model.php
    │   ├── UserModel.php
    │   ├── Pivot.php
    │   ├── MorphPivot.php
    │   ├── Builder.php
    │   └── Scope.php
    ├── Notifications
    │   ├── Messages
    │   │   └── MailMessage.php
    │   └── Notification.php
    ├── Policies
    │   └── Policy.php
    ├── Providers
    │   ├── AuthServiceProvider.php
    │   ├── BroadcastServiceProvider.php
    │   ├── EventServiceProvider.php
    │   └── RouteServiceProvider.php
    ├── Requests
    │   ├── Request.php
    │   └── FormRequest.php
    ├── Responses
    │   ├── Response.php
    │   └── RedirectResponse.php
    ├── Resources
    │   ├── JsonResource.php
    │   └── ResourceCollection.php
    ├── Seeders
    ├── Tests
    │   └── TestCase.php
    ├── Traits
    │   └── CreatesApplication.php
    └── Translations

```

Containers
==========

[](#containers)

1. Standard
-----------

[](#1-standard)

To create container with necessary files and folders you need to put this command:

```
php artisan make:container

```

Without forced container type will be created standard container structure.

#### Standard Container's Structure

[](#standard-containers-structure)

```
Container
	├── Actions
	├── Tasks
	├── Models
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php
	└── UI
	    ├── WEB
	    │   ├── Routes
	    │   ├── Controllers
	    │   └── Views
	    ├── API
	    │   ├── Routes
	    │   ├── Controllers
	    │   └── Transformers
	    └── CLI
	        ├── Routes
	        └── Commands

```

2. Default
----------

[](#2-default)

To create container with default route, controller, view and test file you can via command below:

```
php artisan make:container  --default

```

#### Default Container's Structure

[](#default-containers-structure)

```
Container
	├── Actions
	├── Tasks
	├── Models
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php
	└── UI
	    ├── WEB
	    │   ├── Routes
	    │   │   ├── home.php
	    │   ├── Controllers
	    │   │   ├── HomeController.php
	    │   ├── Views
	    │   │   ├── home.blade.php
	    │   ├── Tests
	    │   │   ├── Functional
	    │   └── └── └── ExampleTest.php
	    ├── API
	    │   ├── Routes
	    │   ├── Controllers
	    │   └── Transformers
	    └── CLI
	        ├── Routes
	        └── Commands

```

3. API
------

[](#3-api)

To create container only for API needles you can via command below:

```
php artisan make:container  --api

```

#### API Container's Structure

[](#api-containers-structure)

```
Container
	├── Actions
	├── Tasks
	├── Models
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php
	└── UI
	    └── API
	        ├── Routes
	        ├── Controllers
	        └── Transformers

```

4. CLI
------

[](#4-cli)

To create container only for command line interface needles you can via command below:

```
php artisan make:container  --cli

```

#### CLI Container's Structure

[](#cli-containers-structure)

```
Container
	├── Actions
	├── Tasks
	├── Models
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php
	└── UI
	    └── CLI
	        ├── Routes
	        └── Commands

```

5. WEB
------

[](#5-web)

To create container only for web needles you can via command below:

```
php artisan make:container  --web

```

#### WEB Container's Structure

[](#web-containers-structure)

```
Container
	├── Actions
	├── Tasks
	├── Models
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php
	└── UI
	    └── WEB
	        ├── Routes
	        ├── Controllers
	        └── Views

```

6. Full
-------

[](#6-full)

To create container with full structure you can via command below:

```
php artisan make:container  --full

```

#### Full Container's Structure

[](#full-containers-structure)

```
Container
	├── Actions
	├── Tasks
	├── Models
	├── Values
	├── Events
	├── Listeners
	├── Policies
	├── Exceptions
	├── Contracts
	├── Traits
	├── Enums
	├── Jobs
	├── Notifications
	├── Providers
	├── Configs
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php
	├── Mails
	│   └── Templates
	├── Data
	│   ├── Migrations
	│   ├── Seeders
	│   ├── Factories
	│   ├── Criteria
	│   ├── Repositories
	│   ├── Validators
	│   ├── Transporters
	│   └── Rules
	├── Tests
	│   ├── Traits
	│   └── Unit
	└── UI
	    ├── WEB
	    │   ├── Routes
	    │   ├── Controllers
	    │   ├── Requests
	    │   ├── Tests
	    │   │   └── Functional
	    │   └── Views
	    ├── API
	    │   ├── Routes
	    │   ├── Controllers
	    │   ├── Requests
	    │   ├── Tests
	    │   │   └── Functional
	    │   └── Transformers
	    └── CLI
	        ├── Routes
	        ├── Commands
	        └── Tests
	            └── Functional

```

Laravel console commands
========================

[](#laravel-console-commands)

1. Make
-------

[](#1-make)

This is a list of adapted laravel console commands for the Porto.

Without container name some commands will be created class in the Ship.

Other commands require the container name

### make:cast

[](#makecast)

```
php artisan make:cast  --container=

```

### make:channel

[](#makechannel)

```
php artisan make:channel  --container=

```

### make:command

[](#makecommand)

```
php artisan make:command
php artisan make:command  --container=

```

### make:component

[](#makecomponent)

```
php artisan make:component  --container=

```

### make:controller

[](#makecontroller)

```
php artisan make:controller  --container=

```

### make:enum

[](#makeenum)

```
php artisan make:enum  --container=

```

### make:event

[](#makeevent)

```
php artisan make:event
php artisan make:event  --container=

```

### make:exception

[](#makeexception)

```
php artisan make:exception
php artisan make:exception  --container=

```

### make:factory

[](#makefactory)

```
php artisan make:factory  --container=

```

### make:job

[](#makejob)

```
php artisan make:job
php artisan make:job  --container=

```

### make:listener

[](#makelistener)

```
php artisan make:listener  --container=

```

### make:mail

[](#makemail)

```
php artisan make:mail
php artisan make:mail  --container=

```

### make:middleware

[](#makemiddleware)

```
php artisan make:middleware
php artisan make:middleware  --container=

```

### make:model

[](#makemodel)

```
php artisan make:model  --container=

```

### make:notification

[](#makenotification)

```
php artisan make:notification
php artisan make:notification  --container=

```

### make:observer

[](#makeobserver)

```
php artisan make:observer  --container=

```

### make:policy

[](#makepolicy)

```
php artisan make:policy  --container=

```

### make:provider

[](#makeprovider)

```
php artisan make:provider
php artisan make:provider  --container=

```

### make:request

[](#makerequest)

```
php artisan make:request  --container= --uiType=api
php artisan make:request  --container= --uiType=web

```

### make:resource

[](#makeresource)

```
php artisan make:resource  --container=

```

### make:rule

[](#makerule)

```
php artisan make:rule  --container=

```

### make:scope

[](#makescope)

```
php artisan make:scope  --container=

```

### make:seeder

[](#makeseeder)

```
php artisan make:seeder
php artisan make:seeder  --container=

```

### make:test

[](#maketest)

```
php artisan make:test  --container= --uiType=api
php artisan make:test  --container= --uiType=cli
php artisan make:test  --container= --uiType=web

```

2. Model
--------

[](#2-model)

### make:show

[](#makeshow)

```
php artisan make:show --container=

```

Additional console commands
===========================

[](#additional-console-commands)

1. Make
-------

[](#1-make-1)

This is a list of console commands for the Porto who does not exists in Laravel.

Without container name some commands will be created class in the Ship.

Other commands require the container name

### make:action

[](#makeaction)

```
php artisan make:action  --container=

```

### make:config

[](#makeconfig)

```
php artisan make:config
php artisan make:config  --container=

```

### make:contract

[](#makecontract)

```
php artisan make:contract  --container=

```

### make:helper

[](#makehelper)

```
php artisan make:helper

```

### make:repository

[](#makerepository)

```
php artisan make:repository

```

### make:task

[](#maketask)

```
php artisan make:task  --container=

```

### make:trait

[](#maketrait)

```
php artisan make:trait  --container=
php artisan make:trait  --container= --test

```

### make:translation

[](#maketranslation)

```
php artisan make:translation  --lang=

```

### make:value

[](#makevalue)

```
php artisan make:value  --container=

```

License
-------

[](#license)

Released under the MIT License, see [LICENSE](LICENSE).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

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

Total

79

Last Release

942d ago

Major Versions

v8.0.6 → v9.0.52023-11-20

v8.0.7 → v9.0.62023-11-20

v9.0.6 → v10.0.62023-11-20

v8.0.8 → v9.0.72023-12-02

v5.5.4 → v10.0.72023-12-02

PHP version history (9 changes)v1.0.0PHP ^8.0

v1.1.6PHP ^8.1

v9.0.0PHP ^8.0.2

v8.0.0PHP ^7.3

v7.0.0PHP ^7.2.5

v5.8.0PHP ^7.1.3

v5.5.0PHP &gt;=7.0.0

v8.0.1PHP ^7.3|^8.0

v7.0.1PHP ^7.2.5|^8.0

### Community

Maintainers

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

---

Top Contributors

[![alxdorosenco](https://avatars.githubusercontent.com/u/63168699?v=4)](https://github.com/alxdorosenco "alxdorosenco (51 commits)")

---

Tags

phplaravelPortotemplatearchitecturepatternlaravel-portolaravel-porto-consoleporto-for-laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alxdorosenco-porto-for-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/alxdorosenco-porto-for-laravel/health.svg)](https://phpackages.com/packages/alxdorosenco-porto-for-laravel)
```

###  Alternatives

[tomatophp/filament-wallet

Account Balance / Wallets Manager For FilamentPHP and Filament Account Builder

3731.2k2](/packages/tomatophp-filament-wallet)[tomatophp/filament-subscriptions

Manage subscriptions and feature access with customizable plans in FilamentPHP

649.6k](/packages/tomatophp-filament-subscriptions)[tomatophp/filament-plugins

Manage your modules as a plugin system with plugin generator

634.9k2](/packages/tomatophp-filament-plugins)[tomatophp/filament-docs

Manage your documents and contracts all in one place with template builder

452.7k](/packages/tomatophp-filament-docs)

PHPackages © 2026

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