An open API service indexing awesome lists of open source software.

https://github.com/matheusfsc28/layercraft

LayerCraft is a Composer package designed to streamline the creation of layered architecture in Laravel applications. This package automates the generation of necessary folders and templates for classes and interfaces, significantly reducing development time and enhancing code organization.
https://github.com/matheusfsc28/layercraft

composer craft laravel layer layercraft layered-architecture package php

Last synced: 4 months ago
JSON representation

LayerCraft is a Composer package designed to streamline the creation of layered architecture in Laravel applications. This package automates the generation of necessary folders and templates for classes and interfaces, significantly reducing development time and enhancing code organization.

Awesome Lists containing this project

README

          

## Langs

- [PT-BR πŸ‡§πŸ‡·](#layercraft_pt)
- [EN-US πŸ‡ΊπŸ‡Έ](#layercraft_en)

# LayerCraft_PT

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.

## InstalaΓ§Γ£o

VocΓͺ pode instalar o pacote via Composer. Execute o seguinte comando no seu terminal:

```bash
composer require matheusfsc28/layercraft
```

## Como usar

No seu terminal, na pasta do seu projeto Laravel, execute o seguinte comando:

```bash
php artisan layercraft
```

Isso criarΓ‘ a seguinte estrutura no projeto:

```bash
/seu-projeto
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ Http/
β”‚ β”‚ └── Controllers/
β”‚ β”‚ └── Controller.php
β”‚ β”œβ”€β”€ Interfaces/
β”‚ β”‚ └── Interface.php
β”‚ β”œβ”€β”€ Models/
β”‚ β”‚ └── .php
β”‚ β”œβ”€β”€ Repositories/
β”‚ β”‚ └── Repository.php
β”‚ └── Services/
β”‚ └── Service.php
```

VocΓͺ tambΓ©m pode criar suas subpastas para manter a organizaΓ§Γ£o de acordo com suas necessidades:

```bash
php artisan layercraft \
```

A estrutura ficarΓ‘ da seguinte maneira:

```bash
/seu-projeto
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ Http/
β”‚ β”‚ └── Controllers/
β”‚ β”‚ └── /
β”‚ β”‚ └── Controller.php
β”‚ β”œβ”€β”€ Interfaces/
β”‚ β”‚ └── /
β”‚ β”‚ └── Interface.php
β”‚ β”œβ”€β”€ Models/
β”‚ β”‚ └── /
β”‚ β”‚ └── .php
β”‚ β”œβ”€β”€ Repositories/
β”‚ β”‚ └── /
β”‚ β”‚ └── Repository.php
β”‚ └── Services/
β”‚ └── /
β”‚ └── Service.php
```

### Estrutura Detalhada

- **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.

## LicenΓ§a

Este projeto estΓ‘ licenciado sob a LicenΓ§a MIT. Veja o arquivo LICENSE para mais detalhes.

## Contato

Se vocΓͺ tiver dΓΊvidas ou sugestΓ΅es, entre em contato:

- **Nome**: Matheus Felipe
- **Email**:
- **GitHub**: [![GitHub](https://img.shields.io/badge/GitHub-matheusfsc28-blue?style=flat-square)](https://github.com/matheusfsc28)
- **LinkedIn**: [![LinkedIn](https://img.shields.io/badge/LinkedIn-matheusfsc28-blue?style=flat-square)](https://www.linkedin.com/in/matheusfsc28)

#

# LayerCraft_EN

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.

## Installation

You can install the package via Composer. Run the following command in your terminal:

```bash
composer require matheusfsc28/layercraft
```

## How to use

In your terminal in the root of your Laravel project, run the following command:

```bash
php artisan layercraft
```

This will create the following structure in the project:

```bash
/your-project
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ Http/
β”‚ β”‚ └── Controllers/
β”‚ β”‚ └── Controller.php
β”‚ β”œβ”€β”€ Interfaces/
β”‚ β”‚ └── Interface.php
β”‚ β”œβ”€β”€ Models/
β”‚ β”‚ └── .php
β”‚ β”œβ”€β”€ Repositories/
β”‚ β”‚ └── Repository.php
β”‚ └── Services/
β”‚ └── Service.php
```

You can also create your subfolders to keep according to your organization:

```bash
php artisan layercraft \
```

The structure will be as follows:

```bash
/your-project
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ Http/
β”‚ β”‚ └── Controllers/
β”‚ β”‚ └── /
β”‚ β”‚ └── Controller.php
β”‚ β”œβ”€β”€ Interfaces/
β”‚ β”‚ └── /
β”‚ β”‚ └── Interface.php
β”‚ β”œβ”€β”€ Models/
β”‚ β”‚ └── /
β”‚ β”‚ └── .php
β”‚ β”œβ”€β”€ Repositories/
β”‚ β”‚ └── /
β”‚ β”‚ └── Repository.php
β”‚ └── Services/
β”‚ └── /
β”‚ └── Service.php
```

## Detailed Structure

- **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.

## Contact

If you have any questions or suggestions, please contact:

- **Name**: Matheus Felipe
- **Email**:
- **GitHub**: [![GitHub](https://img.shields.io/badge/GitHub-matheusfsc28-blue?style=flat-square)](https://github.com/matheusfsc28)
- **LinkedIn**: [![LinkedIn](https://img.shields.io/badge/LinkedIn-matheusfsc28-blue?style=flat-square)](https://www.linkedin.com/in/matheusfsc28)

#