jiaojie/laravel5-jsonp-response

Jsonp Response for Laravel Framework 5.x
24
Install
composer require jiaojie/laravel5-jsonp-response
Latest Version:0.1.2
PHP:>=5.4.0
License:MIT
Last Updated:Sep 23, 2016
Links: GitHub  ·  Packagist
Maintainer: jiaojie1989

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.

Related Packages

erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

619,738,036 9,700
laravel/framework

The Laravel Framework.

564,719,134 34,875
laravel/tinker

Powerful REPL for the Laravel framework.

475,095,200 7,439