New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

spitoglou/multi-api

Multiple response formats
35
Install
composer require spitoglou/multi-api
Latest Version:0.2
Laravel:5
License:MIT
Last Updated:Feb 15, 2026
Links: GitHub  ·  Packagist
Maintainer: spitoglou

Laravel 5.2 Multi Api Package

Build Status Latest Stable Version Latest Unstable Version Total Downloads License

spitoglou/multi-api

This package was initially developed for personal (and colleague) use.

It provides the necessary functionality to produce api responses in JSON, XML or HTML (simple table) formats. The api consumer determines the format of the response he/she needs by setting the "Accept" header of the request accordingly ("application/json", "application/custom+xml","application/text" respectively).

Install

Via Composer

$ composer require spitoglou/multi-api

Usage

Normal Response
$array = [["name"=>"Stavros", "surname"=>"Pitoglou],["name"=>"John", "surname"=>"Doe"];
$sender = new Spitoglou\MultiApi\Sender($array);
$sender->finalSend();
Error
$array = ["errorCode"=>"654987", "errorDescription"=>"Some Exotic Error]
$sender = new Spitoglou\MultiApi\Sender($array);
$sender->sendError(500);

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Have Not Added Tests yet...

Security

If you discover any security related issues, please email s.pitoglou@csl.gr instead of using the issue tracker.

Credits

  • [Stavros Pitoglou][link-author]

License

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

Related Packages

mtownsend/response-xml

The missing XML support for Laravel's Response class.

1,457,641 104
nathanmac/parser

Simple PHP Parser Utility Library for API Development

1,023,017 210
kennedy-osaze/laravel-api-response

Renders consistent HTTP JSON responses for API-based projects

5,148 65
peterdkc/parser

Simple PHP Parser Utility Library for API Development

2,540 2
nicklaw5/larapi

A simple Laravel 5 class for handling json api responses.

1,550 11

Version History

Version Released Laravel License
0.2 ~5 MIT
Pre-releases (2)
Version Released Laravel License
0.1.1alpha ~5 MIT
0.1.0alpha ~5 MIT