faustbrian/collection-export

Export Collections into several file formats

v2.0.0 2017-10-10 05:19 UTC

README

Build Status PHP from Packagist Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

composer require faustbrian/collection-export

And then include the service provider within app/config/app.php.

BrianFaust\CollectionExport\CollectionExportServiceProvider::class

Usage

Export/Download an Illuminate\Support\Collection
(new BrianFaust\CollectionExport\Export)->filename('users')->csv(User::get());
(new BrianFaust\CollectionExport\Export)->filename('users')->json(User::get());
(new BrianFaust\CollectionExport\Export)->filename('users')->pdf(User::get());
(new BrianFaust\CollectionExport\Export)->filename('users')->xls(User::get());
(new BrianFaust\CollectionExport\Export)->filename('users')->xlsx(User::get());
(new BrianFaust\CollectionExport\Export)->filename('users')->xml(User::get());
(new BrianFaust\CollectionExport\Export)->filename('users')->yaml(User::get());
(new BrianFaust\CollectionExport\Export)->filename('users')->yamlInline(User::get());

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover a security vulnerability within this package, please send an e-mail to hello@brianfaust.me. All security vulnerabilities will be promptly addressed.

Credits

License

MIT © Brian Faust