a tool for scraping datatables data from lpse website indonesia gov.
- PHP 7.4 or greater
composer require muhfarkhans/lpsegg
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
$array = $lp->getArray($data);
print_r($array);
$json = $lp->getJson($data);
echo $json;