Download the PHP package williamjss/layers without Composer
On this page you can find all versions of the php package williamjss/layers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download williamjss/layers
More information about williamjss/layers
Files in williamjss/layers
Package layers
Short Description A laravel package to generate files for layered architecture
License MIT
Informations about the package layers
Layers
A laravel package to generate files for layered architecture and automate interface bindings.
Recommended Laravel version: ^9.0
Go to Laravel Docs to see support policy.
Summary
- Requirements
- Installation
- Configuration
- Usage
- Generate Layers
- Generate Layers with Subfolders
- Generate Services with more than one repository
Requirements
Installation
Configuration
This command will copy Layers config to your project config folder
Into this file, you can switch the services/repositories default path. For this, keep the namespace and path keys both equals.
Usage
Using the layers artisan command, we can be generate files for repositories (interface and eloquent) and services.
php artisan layers + {option} + {model name}
Available options:
- -e or --eloquent : Generate a repository eloquent for the model
- -i or --interface : Generate a repository interface for the model
- -s or --service : Generate a service for the model
- -r or --repository : Generate a repository interface and eloquent for the model
- -a or --all : Generate a service, repository interface and repository eloquent for the model
- --wr : Specify the service's repositories
Subcommands
php artisan layers:repository --eloquent: the same as php artisan layers --eloquentphp artisan layers:repository --interface: the same as php artisan layers --interfacephp artisan layers:service: the same as php artisan layers --servicephp artisan layers:binds: List all binds from application
Generate Layers
This command will generate 3 files:
- app/Repositories/UserRepositoryInterface.php
- app/Repositories/UserRepositoryEloquent.php
- app/Services/UserService.php
UserRepositoryInterface.php
UserRepositoryEloquent.php
UserService.php
Generate Layers with Subfolders
This command will generate 2 files:
- app/Repositories/User/AddressRepositoryInterface.php
- app/Repositories/User/AddressRepositoryEloquent.php
Generate Services with more than one repository
This command will generate the follow file:
All versions of layers with dependencies
symfony/finder Version ^6.3
illuminate/support Version ^9.0 || ^10.20
illuminate/console Version ^9.0 || ^10.20