PHP code example of gfarias / laravel-previ-scraper

1. Go to this page and download the library: Download gfarias/laravel-previ-scraper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gfarias / laravel-previ-scraper example snippets



public function handle(PreviScraper $previScraper): void {
    $sii = $previScraper->sii();
    print_r($sii->all());
}

$previScraper = new Gfarias\PreviScraper\PreviScraper();
$previred = $previScraper->previred();
$sii = $previScraper->sii();

print_r($previred->all());
print_r($sii->all());


$previScraper = new PreviScraper();
$indicadoresMensuales = $previScraper->sii(5, 2021)->getIndicadoresMensuales();
print_r($indicadoresMensuales);

$previScraper = new PreviScraper();
$previred = $previScraper->previred();
$rentaTopeImponible = $previred->getRentaTopeImponibleCesantia();
$porcentajeSisAfpHabitat = $previred->getAfpHabitat()->getPorcentajeSis();
$aporteCesantiaEmpleadorPlazoFijo = $previred->getSeguroCesantia()->getPlazoFijoEmpleador();