jiaojie / laravel5-jsonp-response
Jsonp Response for Laravel Framework 5.x
Package info
github.com/jiaojie1989/laravel5-jsonp-response
pkg:composer/jiaojie/laravel5-jsonp-response
0.1.2
2016-09-23 08:17 UTC
Requires
- php: >=5.4.0
- laravel/framework: ~5.0
This package is auto-updated.
Last update: 2026-02-24 06:48:25 UTC
README
Requirements
- PHP >= 5.4
- Laravel >= 5.0
Usage
-
Install Simply run
composer install "jiaojie/laravel5-jsonp-response". -
Add the following middleare to your
app\Http\Kernel.php
protected $middleware = [ "Jiaojie\Laravel\Middlewares\Jsonp\JsonpResponse", ];
- When the request uri includes param
__jsonp=true&callback=sthCallback, the api automaticly changes into jsonp format.
/**/myCallback(["date","2016-09-13 19:15:07"]);
Notice
- If param
callbackis set to a number, then the javascript callback function is forced to be namedcallback.