Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lakshmaji/exceptions
https://github.com/lakshmaji/exceptions
composer exceptions laravel
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lakshmaji/exceptions
- Owner: lakshmaji
- Created: 2018-06-10T05:36:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-08T11:16:19.000Z (over 3 years ago)
- Last Synced: 2024-10-10T05:36:46.689Z (28 days ago)
- Topics: composer, exceptions, laravel
- Language: PHP
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Laravel Custom Exceptions Package
### Install with composer
```bash
composer require lakshmaji/exceptions
```Service provider will be registered automatically
Publish translations
```php
php artisan vendor:publish
```### Custom Exception class
```php
12000, 'code' => 400];
// General Error
/**
* @var array
*/
public static $GENERAL_ERROR = ['error_code' => 10001, 'code' => 400];
}
// end of class GenericExceptionType
// end of file GenericExceptionType.php
```### Usage
```php
// In controller
throw new GenericException(CustomException::$DUPLICATE_ORGANIZATION);
```### License
[MIT](https://opensource.org/licenses/MIT)