Download the PHP package coreproc/nova-data-sync without Composer

On this page you can find all versions of the php package coreproc/nova-data-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nova-data-sync

Laravel Nova Data Sync

This is a Laravel Nova tool to that provides features to import and export CSV files.

Import Action

Installation

You can install the package in to a Laravel app that uses Nova via composer:

Publish the package's config and migrations:

This package requires Laravel Horizon and comes with the package. If you have not gone through Horizon's install process yet, you can install it by running:

Make sure to configure Horizon's environment processes in config/horizon.php.

You should also migrate the job batches table:

This package also requires spatie/laravel-media-library and comes with this package. If you have not gone through the installation process of Media Library, you should publish the migrations for it:

Publish Media Library's config file:

Also run the following command to publish the config file for ebess/advanced-nova-media-library:

Usage

Add the tool to your NovaServiceProvider.php:

The Nova Data Sync tool should now appear in Nova's sidebar.

Importing Data Using a Nova Action

To start with creating an Import feature, you will need two create two classes that extend the following:

Here is a sample ImportProcessor:

The rules() method is where you can define the validation rules for each row of the CSV file. It will be passed the $row and $rowIndex parameters. The $row parameter is an array of the CSV row's data. The $rowIndex parameter is the index. Return an array of Laravel's validation rules.

The expected headers are defined in the expectedHeaders() method. This is used to validate the headers of the CSV.

The process() method is where you can define the logic for each row of the CSV file. It will be passed the $row and $rowIndex parameters. The $row parameter is an array of the CSV row's data. The $rowIndex parameter is the index.

If you throw an Exception inside the process() method, the row will be marked as failed and the exception message will be shown in the failed report for the Import.

Next, create an ImportNovaAction class and define the $processor class you just created.

Next, put your ImportNovaAction inside the actions() method of one of your Nova Resources:

It should look something like this:

Import Action

Using the Import feature without the Nova Action

If you want to use the Import feature without the Nova Action, you can still use your ImportProcessor class. Here is an example of grabbing a file from S3 and importing it:

This will dispatch the jobs necessary to handle the import. You'll also be able to see the progress of the import in the Nova Data Sync tool.

Importing Configuration

You can find configuration options for the Import feature in config/nova-data-sync.php.

Exporting Data Using a Nova Action

To start with creating an Export feature, you will need two create two classes that extend ExportProcessor and ExportNovaAction.

Here is a sample ExportProcessor:

You can also format the row data by defining the formatRow() method:

You can also define the query() method to return a query builder. This is useful if you want to export data from a database table.

You can also override methods in the ExportProcessor class to customize the export process. The following methods can be overridden:

Next, in order to use it as a Nova Action, create an ExportNovaAction class and create a processor() function that returns the processor class you just created.

If you have additional fields that you want to add to the Export feature, you can define them in the fields() method and access them through the $fields property.

Now, you can add the ExportNovaAction to your Nova Resource:

User Configuration

Each import and export have a morphable user() relationship. This is used to determine who imported or exported the data. You will need to define Nova resource of each user type that you want to use for the import and export features. This can be done in the config/nova-data-sync.php file.

By default, this already has the App\Nova\User::class resource. You can add more user resources like App\Nova\BackendUser as needed.


All versions of nova-data-sync with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
anourvalar/eloquent-serialize Version ^1.0
ebess/advanced-nova-media-library Version ^4.1
flatroy/nova-progressbar-field Version ^0.0.6
laravel/horizon Version ^5.21
spatie/laravel-medialibrary Version ^10.0|^11.0
spatie/simple-excel Version ^3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package coreproc/nova-data-sync contains the following files

Loading the files please wait ....