diff --git a/README.md b/README.md index 2e3e34e..f2de198 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,32 @@ # API Problem for Laravel +[![Build Status](https://github.com/API-Skeletons/laravel-api-problem/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/API-Skeletons/laravel-api-problem/actions/workflows/continuous-integration.yml?query=branch%3Amain) +[![Code Coverage](https://codecov.io/gh/API-Skeletons/laravel-api-problem/branch/main/graphs/badge.svg)](https://codecov.io/gh/API-Skeletons/laravel-api-problem/branch/main) +[![PHP Version](https://img.shields.io/badge/PHP-8.0%2b-blue)](https://img.shields.io/badge/PHP-8.0%2b-blue) +[![Total Downloads](https://poser.pugx.org/api-skeletons/laravel-api-problem/downloads)](//packagist.org/packages/api-skeletons/laravel-api-problem) +[![License](https://poser.pugx.org/api-skeletons/laravel-api-problem/license)](//packagist.org/packages/api-skeletons/laravel-api-problem) + This repository implements [RFC 7807](https://www.rfc-editor.org/rfc/rfc7807.html) -"Problem Details for HTTP APIs" +"Problem Details for HTTP APIs" for Laravel. + +## Installation + +Run the following to install this library using [Composer](https://getcomposer.org/): + +```bash +composer require api-skeletons/laravel-api-problem +``` + +## Quick Start + +```php +use ApiSkeletons\Laravel\ApiProblem\Facades\ApiProblem; + +return ApiProblem::response(401, 'Detailed Unauthorized Message'); +``` +## Attribution +The bulk of this repository was copied from Laminas API Tools. I wanted to provide a +simplified interface specific to Laravel. Though the tool could have been used directly +from the Laminas library it would have come with a lot of overhead. Thanks Laminas. diff --git a/composer.json b/composer.json index 6f38248..e42d0ba 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "require": { "php": "^8.0", "doctrine/instantiator": "^1.4", - "laravel/framework": "^8.80" + "laravel/framework": "^8.0||^9.0" }, "require-dev": { "doctrine/coding-standard": "^9.0",