muhfarkhans/lpsegg

There is no license information available for the latest version (v1.1.0) of this package.

v1.1.0 2022-07-12 04:24 UTC

This package is auto-updated.

Last update: 2024-05-15 06:57:22 UTC


README

a tool for scraping datatables data from lpse website indonesia gov.

Requirements

  • PHP 7.4 or greater

Installation

composer require muhfarkhans/lpsegg

Usage

Lpse-gg is available on Packagist (using semantic versioning), and installation via composer is the recommended way to install thic package. Just add this line to your composer.json file:

"muhfarkhans/lpsegg": "^1.1"

or run

composer require muhfarkhans/lpsegg

after installation you can import class LpseTable to your controller or php file

use App\Lpsegg\LpseTable;
$lp = new LpseTable();

Step 1: you need create params for get data table. uou can use this link to see what do you need

$params = [
    // 'kategoriId' => 2,
    // 'rekanan' => "", 
    // 'tahun' => "",
    // 'instansiId' => "",
    // 'search[value]' => "",
    // 'start'  => 0, 
    // 'length' => 20, // moderate if start filled
];

$data = $lp->getTable($params);

Step 2: generate response

To Array

$array = $lp->getArray($data);
print_r($array);

To JSON

$json = $lp->getJson($data);
echo $json;