A Laravel e-commerce project with a Domain-Driven Design (DDD) structure.
- PHP ^8.1
- Composer ^2.2
General:
Development:
- Laravel IDE Helper
- Scribe API documentation tool
- Laravel Telescope
- Pest Testing Framework
- Grum PHP
- Security Advisor
- DDD (Domain Driven Design)
- API Response Helper
- Scribe Api Tags
- Global Helper
- Migration Structure
- Polymorphic Mapping
- Database Seeders
- Shared Directory
- Enable Model Strict Mode
- Pest testing framework
A simple trait allowing consistent API responses throughout your Laravel application.
Method | Status |
---|---|
okResponse() |
200 |
createdResponse() |
201 |
failedResponse() |
400 |
unauthorizedResponse() |
401 |
forbiddenResponse() |
403 |
notFoundResponse() |
404 |
unprocessableResponse() |
422 |
serverErrorResponse() |
500 |
Additional scribe tags that match the ApiResponseHelper responses.
Tag | Status |
---|---|
@okResponse |
200 |
@createdResponse |
201 |
@failedResponse |
400 |
@unauthorizedResponse |
401 |
@forbiddenResponse |
403 |
@notFoundResponse |
404 |
@unprocessableResponse |
422 |
@serverErrorResponse |
500 |
Tag | Description |
---|---|
@usesPagination |
will add page[number] and page[size] to the query parameters |
Simple php file that contains you global functions, which you can find it in ./src/shared/Helpers/global.php
.
In order to group your migration files by their domains, you can create additional migration directories
and load them in the AppServiceProvider
using loadMigrationsFrom
function:
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
$this->loadMigrationsFrom([
database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'Client',
]);
}
}
The src/shared/
directory is used for helper, traits, enums .... that are going to be used by the application and the domain.