Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Jan 20, 2022
1 parent 5c19f5d commit 84ae3cc
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 84ae3cc

Please sign in to comment.