marshmallow / nova-tool-data-importer
A fully-fledged Excel & CSV import tool for Laravel Nova. The importer will use your own validation rules on every row. It can run in browser and in queued jobs. When running as a job, events will fire to let you know what is happening.
Requires
- php: ^7.1|^8.0
- maatwebsite/excel: ^3.1
- pusher/pusher-php-server: ~4.0
This package is auto-updated.
Last update: 2024-10-30 02:26:56 UTC
README
Marshmallow Laravel Nova Importer
Import data to your Laravel Nova models. You can use jobs if you're expecting large files.
See it in action in a GIFInstallation
You can install the package via composer:
composer require marshmallow/nova-data-importer
The importer needs to have a table to store some data so please run a migration.
php artisan migrate
Usage
In app/Providers/NovaServiceProvider.php
you need to add the Import tool.
public function tools()
{
return [
...
new \Marshmallow\NovaDataImporter\NovaDataImporter,
];
}
Set up queues (optional)
First, we need to make sure you are able to run queues. If you are already running queues you don't have to change your current behaviour.
Prepare your application to handle queues from the database. Skip this if you already have queues set up.
php artisan queue:table php artisan migrate
Update your .env
file first:
QUEUE_CONNECTION=database BROADCAST_DRIVER=pusher PUSHER_APP_ID=XXX PUSHER_APP_KEY=XXX PUSHER_APP_SECRET=XXX PUSHER_APP_CLUSTER=eu
Last; Inside your config/app.php
uncomment the line below if it is still commented.
[ 'providers' => [ /* * Laravel Framework Service Providers... */ Illuminate\Broadcasting\BroadcastServiceProvider::class, ], ]
Start your worker and you're good to go!
php artisan queue:work --queue=default
Options
If you want to override some of the default options, you need to publish the config file with php artisan vendor:publish
.
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.
Credits
- All Contributors
- Package is based on laravel-nova-csv-import by simonhamp
License
The MIT License (MIT). Please see License File for more information.