Import data to your Laravel Nova models. You can use jobs if you're expecting large files.
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
In app/Providers/NovaServiceProvider.php
you need to add the Import tool.
public function tools()
{
return [
...
new \Marshmallow\NovaDataImporter\NovaDataImporter,
];
}
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
If you want to override some of the default options, you need to publish the config file with php artisan vendor:publish
.
Please see CHANGELOG for more information what has changed recently.
If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.