2017 © Pedro Peláez
 

library laravel-api

Laravel API

image

jenky/laravel-api

Laravel API

  • Thursday, June 28, 2018
  • by Milano
  • Repository
  • 1 Watchers
  • 1 Stars
  • 193 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 34 Versions
  • 8 % Grown

The README.md

Laravel API

Latest Version on Packagist Test Status Codecov Total Downloads Software License, (*1)

The package provides a nice and easy way to define API routes and format JSON error response., (*2)

Install

Installation

You may use Composer to install this package into your Laravel project:, (*3)

``` bash $ composer require jenky/laravel-api, (*4)


After installing, publish its assets using the `vendor:publish` Artisan command. ``` bash php artisan vendor:publish

or, (*5)

``` bash php artisan vendor:publish --provider="Jenky\LaravelAPI\ApiServiceProvider", (*6)


## Configuration After publishing Laravel API's assets, its primary configuration file will be located at `config/api.php`. This configuration file allows you to configure your api route and error response format and each configuration option includes a description of its purpose, so be sure to thoroughly explore this file. > For Header versioning, if the request doesn't have the `Accept` header with correct format then default version from config will be used. ## Usage ### Error response Dealing with errors when building an API can be a pain. Instead of manually building error responses you can simply throw an exception and the API will handle the response for you. Just add the trait `ExceptionResponse` to your `app/Exceptions/Handler` and the package will automatically catches the thrown exception and will convert it into its JSON representation. ``` php <?php namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Jenky\LaravelAPI\Exception\ExceptionResponse; class Handler extends ExceptionHandler { use ExceptionResponse; }

You can change the default error response format in config/api.php file., (*7)

Change log

Please see CHANGELOG for more information on what has changed recently., (*8)

Testing

bash $ composer test, (*9)

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details., (*10)

Security

If you discover any security related issues, please email contact@lynh.me instead of using the issue tracker., (*11)

Credits

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions

28/06 2018

dev-master

9999999-dev https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi

28/06 2018

6.2.0

6.2.0.0 https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi

28/06 2018

dev-develop

dev-develop https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi

25/04 2018

6.1.1

6.1.1.0 https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi

25/04 2018

6.x-dev

6.9999999.9999999.9999999-dev https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi

06/04 2018

6.1.0

6.1.0.0 https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi

07/03 2018

6.0.1

6.0.1.0 https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi

30/11 2017

5.x-dev

5.9999999.9999999.9999999-dev https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi

10/11 2017

6.0.0

6.0.0.0 https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi

18/09 2017

4.x-dev

4.9999999.9999999.9999999-dev https://github.com/jenky/laravel-api

Laravel API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Linh Tran

laravel api restapi