Download the PHP package alxdorosenco/porto-for-laravel without Composer
On this page you can find all versions of the php package alxdorosenco/porto-for-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alxdorosenco/porto-for-laravel
More information about alxdorosenco/porto-for-laravel
Files in alxdorosenco/porto-for-laravel
Package porto-for-laravel
Short Description This package is a solution for easy building and working with Porto pattern structure
License MIT
Homepage https://github.com/alxdorosenco/porto-for-laravel
Informations about the package 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.
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
- How to install?
- Ship structure
- Containers
- Standard
- Default
- API
- CLI
- WEB
- Full
- Laravel console commands
- Make
- make:cast
- make:channel
- make:command
- make:component
- make:controller
- make:enum
- make:event
- make:exception
- make:factory
- make:job
- make:listener
- make:mail
- make:middleware
- make:model
- make:notification
- make:observer
- make:policy
- make:provider
- make:request
- make:resource
- make:rule
- make:scope
- make:seeder
- make:test
- Model
- model:show
- Make
- Additional console commands
- Make
- make:action
- make:config
- make:contract
- make:helper
- make:repository
- make:task
- make:trait
- make:translation
- make:value
- Make
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: https://github.com/Mahmoudz/Porto
How to install?
-
First of all you need to install the package:
-
Next, you need to enable installed package in your .env file:
-
Next, you can install porto structure using this command:
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 -> psr-4 in the composer.json file.
You also can add directory name of your first container. For example:
This container will be installed in the Containers directory with standard structure. You also can force another container structures like:
-
Next, you need to put some changes in the bootstrap/app.php file.
From:
To:
-
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
- 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
This is a skeleton of the installed Ship structure.
Containers
1. Standard
To create container with necessary files and folders you need to put this command:
Without forced container type will be created standard container structure.
Standard Container's Structure
2. Default
To create container with default route, controller, view and test file you can via command below:
Default Container's Structure
3. API
To create container only for API needles you can via command below:
API Container's Structure
4. CLI
To create container only for command line interface needles you can via command below:
CLI Container's Structure
5. WEB
To create container only for web needles you can via command below:
WEB Container's Structure
6. Full
To create container with full structure you can via command below:
Full Container's Structure
Laravel console commands
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
make:channel
make:command
make:component
make:controller
make:enum
make:event
make:exception
make:factory
make:job
make:listener
make:mail
make:middleware
make:model
make:notification
make:observer
make:policy
make:provider
make:request
make:resource
make:rule
make:scope
make:seeder
make:test
2. Model
make:show
Additional console commands
1. Make
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
make:config
make:contract
make:helper
make:repository
make:task
make:trait
make:translation
make:value
License
Released under the MIT License, see LICENSE.