marshmallow-packages / nova-tool-data-importer

A Laravel Nova tool to import excel sheets or CSV files into your database. Validate the data and use workers for large files. Its awesome! 🗂
MIT License
5 stars 1 forks source link

alt text

Marshmallow Laravel Nova Importer

Version Issues Licence PHP Syntax Checker

Import data to your Laravel Nova models. You can use jobs if you're expecting large files.

See it in action in a GIF

Installation

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

License

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