This package helps with exporting factory generated data and Eloquent collections to csv or xlsx formats.
You can install the package via composer:
composer require petersowah/laravel-factory-dumps
You can publish the config file with:
php artisan vendor:publish --tag="laravel-factory-dumps-config"
This is the contents of the published config file:
return [
'path' => env('FACTORY_DUMPS_PATH', __DIR__.'/../workbench/database/dumps'),
];
use PeterSowah\LaravelFactoryDumps\Traits\ExportableFactory;
$user = User::factory(100)->create()->toExcel();
$user = User::factory(100)->create()->toCsv();
$users = User::whereNotNull('email_verified_at')->get();
$users->toExcel();
$users->toCsv();
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.