PHP code example of thiagovictorino / laravel-resource-exporter
1. Go to this page and download the library: Download thiagovictorino/laravel-resource-exporter 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/ */
thiagovictorino / laravel-resource-exporter example snippets
/**
* Getting the export builder
*/
$exporter = \ResourceExporter::endpoint('http://yourl.com/resource?anyfilters');
/**
* optional: Set the Bearer Token on request
*/
$exporter->withBearerToken('abcd123');
/**
* optional: Set the payload as a Bootstrap 3 standard. You can set it automatically
* on configurations
*/
$exporter->withBootstrapThree();
/**
* optional: Add a delay between each requests
*/
$exporter->withDelay(5);
/**
* Will save the file on disk that was set on configurations
*/
$exporter->toCSV('my-file-name');
bash
php artisan vendor:publish --provider="Victorino\ResourceExporter\ResourceExporterServiceProvider"