Skip to content

This package helps you to export a data resource from an api that returns a Laravel pagination payload (including bootstrap 3 payload).

License

Notifications You must be signed in to change notification settings

thiagovictorino/laravel-resource-exporter

Repository files navigation

Laravel Resource Exporter

This package helps you to export a data resource from an api that returns a Laravel pagination payload (including bootstrap 3 payload).

Currently it is exporting for CSV, but any PR is welcome =)

Installation

Add package

composer require thiagovictorino/laravel-resource-exporter

Configuration

To create configuration file run:

php artisan vendor:publish --provider="Victorino\ResourceExporter\ResourceExporterServiceProvider"

Usage

/**
 * 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');

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email eu [at] thiagovictorino.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

About

This package helps you to export a data resource from an api that returns a Laravel pagination payload (including bootstrap 3 payload).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages