Download the PHP package kamranahmedse/laravel-faulty without Composer

On this page you can find all versions of the php package kamranahmedse/laravel-faulty. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-faulty

Laravel Faulty - RESTful Exceptions

Automatically turns your thrown exceptions (HTTP/non-HTTP) to the JSON response while conforming to API problem specification.

A Laravel/Lumen package that lets you handle the API problems with ease.

Faulty provides a straightforward implementation of IETF Problem Specification and turns your exceptions to be returned in the below format with the content type of application/problem+json

Where

Installation

Run the below command

Make your exception handler i.e. App\Exceptions\Handler that can be found at app\Exceptions\Handler.php extend from the Faulty's handler i.e.

And that's it. You are all set to use Faulty.

Configuration

Faulty relies on the following environment configurations

Usage

For HTTP exceptions to be rendered properly with the proper status codes, you should use the exception classes provided by faulty i.e. the ones available in Faulty\Exceptions namespace or use the relevant ones provided by the Symfony's HTTP component i.e. the ones available under Symfony\Component\HttpKernel\Exception

Throwing Exceptions

All the exception classes have the below signature

Here are some of the provided exception classes

Also, if you would like to return any response for which the exception class isn't available, you can use the HttpException class i.e.

Syntactic Sugar

Also, for any of the exception classes above, you can use the below syntax as well.

Also, if you would like to send additional data in response, call the method setAdditional([]) on the error object while passing the additional detail i.e.

Contributing

Feel free to fork, enhance, create PR and lock issues.

License

MIT © Kamran Ahmed


All versions of laravel-faulty with dependencies

PHP Build Version
Package Version
Requires filp/whoops Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kamranahmedse/laravel-faulty contains the following files

Loading the files please wait ....