New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

egeatech/laravel-exceptions

A simple package to better handle Exceptions.
4,044 2
Install
composer require egeatech/laravel-exceptions
Latest Version:3.0.1
PHP:^8.0
Laravel:6 – 10
License:MIT
Last Updated:Jan 9, 2024
Links: GitHub  ·  Packagist
Maintainer: egeatech

Laravel Exceptions

Latest Version on Packagist Total Downloads

A package to help handling exceptions which may occur in your application.

Installation

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

Usage

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.

Change log

Please see the CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

The software is licensed under MIT. Please see the LICENSE file for more information.

Related Packages

velcoda/exceptions

Global Exceptions thrown in the Velcoda Universe

8,296 0
squareboat/sneaker

An easy way to send emails with stack trace whenever an exception occurs on the...

195,298 219
cerbero/exception-handler

Extend Laravel exception handler to define how to handle custom exceptions via s...

7,811 59
smorken/errors

Extended error handling for Laravel

5,999
nextdots/api-exceptions

JSON exceptions for your API

385 0

Version History

Version Released PHP Laravel License
3.0.1 ^8.0 ^6|^7|^8|^9|^10 MIT
3.0.0 ^8.0 ^6|^7|^8|^9|^10 MIT
2.0.0 ^8.0 ^6|^7|^8|^9 MIT
1.3.0 ^7.4|^8.0 ^6|^7|^8|^9 MIT
1.2.0 ^7.4|^8.0 ^6|^7|^8 MIT