A package to help handling exceptions which may occur in your application.
This package supports Laravel 7, 8 and 9 but requires at least PHP 8.0 starting from v2.x. PHP 7.4 is supported up to version 1.3.0.
Via Composer
$ composer require egeatech/laravel-exceptions
During the implementation of the business logic of your application, if you wish to throw an exception
simply create a new class extending EgeaTech\LaravelExceptions\Exceptions\ApplicationException
.
After that, create a new translation file inside your [resources/]lang/en/exceptions
folder:
the file must be the snake case version of the exception class name. Keep in mind that at least the
English form is required.
Now that we're all set, the base exception class will take care of logging the exception in English given its translation key, leaving to the user the choice to return a translated version of the error to the client or, otherwise, return only the exception key for further processes or custom error messages to be displayed.
Please see the CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email author email instead of using the issue tracker.
The software is licensed under MIT. Please see the LICENSE file for more information.