Exceptions
Exceptions are used to handle errors and exceptions in the application.
To generate new exceptions, you may use the apiato:make:exception interactive command:
php artisan apiato:make:exception
Definition and Principles
Read Porto SAP Documentation (#Exceptions).
Rules
- All container-specific Exceptions MUST be placed in the app/Containers/{Section}/{Container}/Exceptionsdirectory.
- All general Exceptions MUST be placed in the app/Ship/Exceptionsdirectory.
- All application Exceptions MUST extend the App\Ship\Parents\Exceptions\Exceptionclass.- The parent extension SHOULD be aliased as ParentException.
 
- The parent extension SHOULD be aliased as 
- All Http Exceptions MUST extend the App\Ship\Parents\Exceptions\HttpExceptionclass.- The parent extension SHOULD be aliased as ParentHttpException.
 
- The parent extension SHOULD be aliased as 
Folder Structure
app
├── Containers
│   └── Section
│       └── Container
│           └── Exceptions
│               ├── SpecificException.php
│               ├── AnotherSpecificException.php
│               └── ...
└── Ship
    └── Exceptions
        ├── GeneralException.php
        ├── AnotherGeneralException.php
        └── ...
Code Example
Exceptions are defined exactly as you would define them in Laravel.