Package Data | |
---|---|
Maintainer Username: | sc0Vu |
Maintainer Contact: | alk03073135@gmail.com (Peter Lai) |
Package Create Date: | 2017-05-27 |
Package Last Update: | 2017-06-08 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:11:30 |
Package Statistics | |
---|---|
Total Downloads: | 18 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 3 |
Total Forks: | 1 |
Total Open Issues: | 0 |
The lumen api response wrapper for rybakit/msgpack.
composer require guancheng/msgpack
or
clone / download this repo
use Illuminate\Routing\Controller;
use LGC\Msgpack\MsgpackResponse;
class TestController extends Controller
{
public function test()
{
return new MsgpackResponse([
'success' => true
]);
}
}
If you want to return Arrayable object, just do it!
use Illuminate\Support\Collection;
use Illuminate\Routing\Controller;
use LGC\Msgpack\MsgpackResponse;
class TestController extends Controller
{
public function test()
{
return new MsgpackResponse([
'success' => true,
'data' => new Collection([
'hello' => 'lumtify'
])
]);
}
}
When use arrayable types you have to notice: due to we don't remember pack data type, so the getData() always return array
use LGC\Msgpack\MsgpackConcern;
class TestApiTest extends PHPUnit_Framework_TestCase
{
use MsgpackConcern;
public function testShouldSeeMsgpack()
{
$this->shouldSeeMsgpack();
}
}
clone the repo
composer install
Make other laravel data type transformer.
MIT
Hey dude! Help me out for a couple of :beers:!