2017 © Pedro Peláez
 

library exceptions

Exception Handler for Laravel

image

lakshmaji/exceptions

Exception Handler for Laravel

  • Sunday, June 10, 2018
  • by lakshmaji
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel Custom Exceptions Package

Install with composer

    composer require lakshmaji/exceptions

Service provider will be registered automatically, (*1)

Publish translations, (*2)

    php artisan vendor:publish 

Custom Exception class


<?php namespace App; use Lakshmaji\Exceptions\GenericExceptionType; /** * ----------------------------------------------------------------------------- * CustomException for defining exception codes * ----------------------------------------------------------------------------- * Class having methods to define error codes related to DB exceptions. * * @since 1.0.0 * @version 1.0.0 * @author Lakshmaji */ class CustomException extends GenericExceptionType { // DUPLICATE RECORD /** * @var array */ public static $DUPLICATE_RECORD = ['error_code' => 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

    // In controller
    throw new GenericException(CustomException::$DUPLICATE_ORGANIZATION);

License

MIT, (*3)

The Versions

10/06 2018

dev-master

9999999-dev

Exception Handler for Laravel

  Sources   Download

MIT

by Avatar lakshmaji

10/06 2018

1.0.0

1.0.0.0

Exception Handler for Laravel

  Sources   Download

MIT

by Avatar lakshmaji