Download the PHP package simonhamp/laravel-nova-csv-import without Composer

On this page you can find all versions of the php package simonhamp/laravel-nova-csv-import. 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 laravel-nova-csv-import

Laravel Nova CSV Import

Latest Stable Version Total Downloads License

A rich and powerful CSV import component for Laravel Nova. CSV Import allows you to easily upload CSV or Excel files and import their data into any Nova resource.

No need to make your file match your database! The import process lets you choose how to map the relevant columns from your uploaded file to the attributes on your models, with a nice summary at the end of what worked and what didn't.

You can even modify values as they're being imported to add hashing or other manipulations, set custom values, random values and now even combine multiple values to be imported into a single field!

This package was originally built on top of work done by Sparclex on the nova-import-card package.

Laravel Nova CSV Import Screenshot

NB: As of v0.4.0, CSV Import requires Nova v4 and above. For Nova versions prior to v4, please use a CSV Import v0.3.0 or lower. Please also be aware that versions prior to v0.4.0 will no longer be maintained.

Sponsorship

CSV Import is completely free to use for personal or commercial use. If it's making your job easier or you just want to make sure it keeps being supported and improved, I'd really appreciate your donations!

Donate now via GitHub Sponsors

Thank you 🙏

Sponsors

Laradir - Connecting the best Laravel Developers with the best Laravel Teams.
quantumweb - A bare-metal web agency. Less layers, better results.
RedGalaxy - A web application development studio based in Cambridgeshire, building solutions to help businesses improve efficiency and profitability.
Sevalla - Host and manage your applications, databases, and static sites in a single, intuitive platform.

Installation

Install via Composer:

Once installed, you must register the component in your app's NovaServiceProvider (usually in app/Providers/NovaServiceProvider.php):

If you have customised your Nova main menu

If you have customised your main menu, then you will need to manually register the tool's menu item in your custom menu for it to appear.

For example, in your app/Providers/NovaServiceProvider.php:

Options

By default, all of your Nova Resources will be available for import. However, there are a number of ways that you can explicitly limit what's available for importing.

public static $canImportResource = false;
Default: true
Add this static property to your Resource to prevent it from showing up in the Nova CSV Import tool interface.

public static function canImportResource($request): bool
Define a canImportResource method to use more complex logic to decide if this Resource can be shown during import. If defined, this takes precedence over the $canImportResource property.

Exclude certain fields

CSV Import aims to respect your Nova configuration, but there are times when you want your imports to behave slightly differently to your Nova interface. For that you can use the excludeAttributesFromImport() method:

public static function excludeAttributesFromImport(): array
Default: []
Define a excludeAttributesFromImport method that returns an array of attribute names that you want to exclude from being visible in the import tool for this Resource.

Example

Importer Class

This package uses maatwebsite/excel behind the scenes to handle the actual import. You can find out more about how importing works.

You can define your own importer class by providing the relevant class name in your published copy of this package's config file.

First, publish the config file:

Then, define and register your own importer class:

Usage

CSV Import is a powerful tool, but I'm trying to make it simple and easy to use for anyone. For tips and tricks please check out my YouTube playlist.

Full documentation is coming.

Testing

We need tests! Can you help? Please consider contributing.

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see LICENSE for more details.


All versions of laravel-nova-csv-import with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/nova Version ^4.0
maatwebsite/excel Version ^3.1
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 simonhamp/laravel-nova-csv-import contains the following files

Loading the files please wait ....