LaravelPackages.net
Acme Inc.
Toggle sidebar
novaday-co/laravel-api-response

This Package helps developers to easily make response for API

1
3
About novaday-co/laravel-api-response

novaday-co/laravel-api-response is a Laravel package for this package helps developers to easily make response for api. It currently has 3 GitHub stars and 1 downloads on Packagist. Install it with composer require novaday-co/laravel-api-response. Discover more Laravel packages by novaday-co or browse all Laravel packages to compare alternatives.

Last updated

Laravel API Response package

Laravel API Response

This Package helps developers to easily make response for API . Add extra data to collection response . Short magic method that use your translate files to set messages .


How to install :

composer require novaday-co/laravel-api-response

How to use :

Success response

Api::success("Successful Action")->response();

Success response

Api::success("Successful Action")->response();

Failure response

Api::failure("Failed")->response();

Custom response

Api::customResponse(201,'Created Successfully',['key'=>'value'])->response();

With data

Api::success('Ok',['key'=>'value'])->response();

External data in data

Api::success('Ok',[ User::all() ])->withData([ Customer::first() ])->response();

External data next to data

Api::success('Ok',[ User::all() ])->with([ 'Customers' => Customer::all() ])->response();

Short magic method for set messages

Api::updated()->response();
Comments