PHP code example of devcortes / laravel-clean-architecture

1. Go to this page and download the library: Download devcortes/laravel-clean-architecture library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

devcortes / laravel-clean-architecture example snippets


use App\Src\Product\Infrastructure\Persistence\Repositories\ProductRepositoryInterface;
use App\Src\Product\Infrastructure\Persistence\Repositories\MongoProductRepository;

$this->app->bind(ProductRepositoryInterface::class, MongoProductRepository::class);
bash
php artisan make:module NombreModulo
bash
php artisan make:module Product

app/Src/Product/
├── Domain/
│   ├── Entities/Product.php
│   └── ValueObjects/ProductId.php
├── Application/
│   └── UseCases/CreateProductUseCase.php
└── Infrastructure/
    ├── Persistence/
    │   ├── Models/ProductModel.php
    │   ├── Repositories/ProductRepositoryInterface.php
    │   └── Repositories/MongoProductRepository.php
    └── Http/
        ├── Controllers/ProductController.php
        └── Requests/CreateProductRequest.php
bash
composer dump-autoload
bash
php artisan vendor:publish --tag=hexagonal-stubs