LaravelPackages.net
Acme Inc.
Toggle sidebar
php-monsters/laravel-xml-response

Added a method to Laravel response for handling xml response and also converting Eloquent return to XML.

99
5
v6.0.1
About php-monsters/laravel-xml-response

php-monsters/laravel-xml-response is a Laravel package for added a method to laravel response for handling xml response and also converting eloquent return to xml.. It currently has 5 GitHub stars and 99 downloads on Packagist (latest version v6.0.1). Install it with composer require php-monsters/laravel-xml-response. Discover more Laravel packages by php-monsters or browse all Laravel packages to compare alternatives.

Last updated

Laravel XML Response

Added a method to Laravel response for handling xml response and also converting Eloquent return to XML.

Composer Installation

composer require php-monsters/laravel-xml-response 

Integration with Laravel 5.0+

for Laravel < 5.6 add to config/app.php

PhpMonsters\XmlResponse\XmlResponseServiceProvider::class

Publish

php artisan vendor:publish --provider="PhpMonsters\XmlResponse\XmlResponseServiceProvider"

Example

// basic usage with default config from xml.php file
Route::get('/', function () {
    return response()->xml(User::all());
});


// custom template like: '<result></result>'
Route::get('/foo', function () {
    return response()->xml(['foo' => 1, 'bar' => 2, 'baz' => 3], [], '<result></result>);
});

Team

This component is developed by the following person(s) and a bunch of awesome contributors.

Aboozar Ghaffari | --- | Aboozar Ghaffari |

License

The Laravel XML Response is open-sourced software licensed under the MIT license

Comments