Pivot table for PHP PivotData Microservice Documentation


Pivot table for PHP

Doesn't matter what framework you use (Laravel, Yii, Symphony), with PivotData microservice pivot tables may be easily added to any PHP application with the following steps:

  1. Deploy PivotData microservice to your server (Linux is ok!) and configure your data sources in appsettings.json
  2. For canned reports: use microservice's web API from your web pages or PHP code (using curl_exec or guzzle library)
  3. For web pivot tables builder: integrate HTML/JS code from index.html (shipped in PivotData microservice package)

What is next:

  • secure access to microservice web API with JSON Web Token. JWT can be easily generated with firebase/php-jwt library:
    $token = [
    	"user" => $currentUserId,			
    	"iss" => $jwtIssuer,
    	"exp" => strtotime("+10 year")
    ];
    $pvtDataServiceJwt = JWT::encode($token, $jwtIssuerSigningKeyStr);
  • provide cubes config dynamically with an URL that is served by your main PHP app. In this way you can implement access control individually for each user (see integration\Php\htdocs\get-cube-schema-by-jwt.php from integration example).
Complete source code of PHP pivot table integration you can found in PivotData microservice trial pack.