LayerCraft é um pacote para gerar uma arquitetura em camadas (Controller, Service, Interface, Repository, Model) em aplicações Laravel. Ele facilita a organização do código e promove boas práticas de desenvolvimento de maneira ágil.
Você pode instalar o pacote via Composer. Execute o seguinte comando no seu terminal:
composer require matheusfsc28/layercraft
No seu terminal, na pasta do seu projeto Laravel, execute o seguinte comando:
php artisan layercraft <YourClassName>
Isso criará a seguinte estrutura no projeto:
/seu-projeto
├── app/
│ ├── Http/
│ │ └── Controllers/
│ │ └── <YourClassName>Controller.php
│ ├── Interfaces/
│ │ └── <YourClassName>Interface.php
│ ├── Models/
│ │ └── <YourClassName>.php
│ ├── Repositories/
│ │ └── <YourClassName>Repository.php
│ └── Services/
│ └── <YourClassName>Service.php
Você também pode criar suas subpastas para manter a organização de acordo com suas necessidades:
php artisan layercraft <YourSubFolder>\<YourClassName>
A estrutura ficará da seguinte maneira:
/seu-projeto
├── app/
│ ├── Http/
│ │ └── Controllers/
│ │ └── <YourSubFolder>/
│ │ └── <YourClassName>Controller.php
│ ├── Interfaces/
│ │ └── <YourSubFolder>/
│ │ └── <YourClassName>Interface.php
│ ├── Models/
│ │ └── <YourSubFolder>/
│ │ └── <YourClassName>.php
│ ├── Repositories/
│ │ └── <YourSubFolder>/
│ │ └── <YourClassName>Repository.php
│ └── Services/
│ └── <YourSubFolder>/
│ └── <YourClassName>Service.php
- Controllers: Contém a lógica do controlador.
- Interfaces: Define a interface que o repositório deve implementar.
- Models: Representa a entidade no banco de dados.
- Repositories: Contém a lógica de acesso a dados.
- Services: Implementa a lógica de negócios.
Este projeto está licenciado sob a Licença MIT. Veja o arquivo LICENSE para mais detalhes.
Se você tiver dúvidas ou sugestões, entre em contato:
- Nome: Matheus Felipe
- Email: dev.matheusfelipe@gmail.com
- GitHub:
- LinkedIn:
LayerCraft is a package to generate a layered architecture (Controller, Service, Interface, Repository, Model) in Laravel applications. It helps organize the code and promotes good development practices in an agile way.
You can install the package via Composer. Run the following command in your terminal:
composer require matheusfsc28/layercraft
In your terminal in the root of your Laravel project, run the following command:
php artisan layercraft <YourClassName>
This will create the following structure in the project:
/your-project
├── app/
│ ├── Http/
│ │ └── Controllers/
│ │ └── <YourClassName>Controller.php
│ ├── Interfaces/
│ │ └── <YourClassName>Interface.php
│ ├── Models/
│ │ └── <YourClassName>.php
│ ├── Repositories/
│ │ └── <YourClassName>Repository.php
│ └── Services/
│ └── <YourClassName>Service.php
You can also create your subfolders to keep according to your organization:
php artisan layercraft <YourSubFolder>\<YourClassName>
The structure will be as follows:
/your-project
├── app/
│ ├── Http/
│ │ └── Controllers/
│ │ └── <YourSubFolder>/
│ │ └── <YourClassName>Controller.php
│ ├── Interfaces/
│ │ └── <YourSubFolder>/
│ │ └── <YourClassName>Interface.php
│ ├── Models/
│ │ └── <YourSubFolder>/
│ │ └── <YourClassName>.php
│ ├── Repositories/
│ │ └── <YourSubFolder>/
│ │ └── <YourClassName>Repository.php
│ └── Services/
│ └── <YourSubFolder>/
│ └── <YourClassName>Service.php
- Controllers: Contains the controller logic.
- Interfaces: Defines the interface that the repository must implement.
- Models: Represents the entity in the database.
- Repositories: Contains the data access logic.
- Services: Implements the business logic.
If you have any questions or suggestions, please contact:
- Name: Matheus Felipe
- Email: dev.matheusfelipe@gmail.com
- GitHub:
- LinkedIn: