LaravelPackages.net
Acme Inc.
Toggle sidebar
jiaojie/laravel5-jsonp-response

Jsonp Response for Laravel Framework 5.x

24
0
0.1.2
About jiaojie/laravel5-jsonp-response

jiaojie/laravel5-jsonp-response is a Laravel package for jsonp response for laravel framework 5.x. It currently has 0 GitHub stars and 24 downloads on Packagist (latest version 0.1.2). Install it with composer require jiaojie/laravel5-jsonp-response. Discover more Laravel packages by jiaojie or browse all Laravel packages to compare alternatives.

Last updated

Jsonp Response Format for Laravel Framework 5.x

Latest Stable Version Total Downloads Latest Unstable Version License

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 callback is set to a number, then the javascript callback function is forced to be named callback.

Star History Chart