Download the PHP package eightynine/filament-excel-import without Composer

On this page you can find all versions of the php package eightynine/filament-excel-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 filament-excel-import

Filament Excel Import

Latest Version on Packagist Total Downloads

This package adds a new feature to your filament resource, allowing you to easily import data to your model

This package brings the maatwebsite/laravel-excel functionalities to filament. You can use all the maatwebsite/laravel-excel features in your laravel project

🛠️ Be Part of the Journey

Hi, I'm Eighty Nine. I created excel import plugin to solve real problems I faced as a developer. Your sponsorship will allow me to dedicate more time to enhancing these tools and helping more people. Become a sponsor and join me in making a positive impact on the developer community.

Installation

You can install the package via composer:

Usage

Before using this action, make sure to allow Mass Assignment for your model. If you are doing a custom import, this is not necessary.

For example, if you have a ClientResource in your project, integrate the action into ListClients class as demonstrated below:

Customise Import Process

Using a closure

You can use a closure to process the collection after it has been imported.

Using your own Import class

If you wish to use your own import class to change the import procedure, you can create your own Import class.

Then in your action use your client import class

Form Customisation

You can customise the form by using the beforeUploadField and afterUploadField methods. These methods accept an array of fields that will be added to the form before and after the upload field. You can also use the uploadField method to customise the upload field.

Custom Upload Disk

To use a custom upload disk, you can publish the config file and customise the upload_disk config.

Then in your config file, you can customise the upload_disk config.

Performing Actions Before and After Import

You can perform actions before and after import by using the beforeImport and afterImport closures.

$data is the data that is submitted via the form, meaning the file upload is also available in $data['upload'], and $livewire is the Livewire instance that the action is being performed on (in this case, the ListClients class).

Data Validation

You can validate the data before importing by using the validateUsing method. This method accepts an array of rules that will be used to validate the data. You can use all the rules from the Laravel validation system.

Mutating data before and after validation

In some cases you may want to mutate the data before or after validation, in order to achieve this, you can use mutateBeforeValidationUsing and mutateAfterValidationUsing functions methods.

Sample Excel File

You can allow users to download a sample excel file by using the sampleExcel method. This method accepts an array of data, a file name, an export class and a sample button label.

Using import action to import relationships

The import action can also be used to import relationships. This is done by using the DefaultRelationshipImport class in your relation manager.

Stopping Imports and Returning Messages

New in v3.1.5+: You can now stop the import process from within your custom import class and return messages to the frontend. This is useful for:

Using Enhanced Import Classes

The package now provides EnhancedDefaultImport and EnhancedDefaultRelationshipImport classes that include methods to stop imports:

Available Methods

Stop Import Methods:

Validation Helpers:

Hook Methods (override in your class):

Using with Form Data

You can access custom form data in your import class for validation:

Using with Existing Import Classes

If you have existing import classes, you can add stopping capabilities by throwing the ImportStoppedException:

The exception constructor accepts:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

CSS Styling and Theme Integration

Avoiding CSS Conflicts

By default, this package loads minimal CSS to avoid conflicts with your application's existing button styles and theme. The stylesheet loading is disabled by default to prevent issues with [type="button"] selectors and other global styles.

If you need to enable the custom stylesheet, you can publish the config file and set load_stylesheet to true:

Then in your config/excel-import.php file:

Theme Integration

The Excel Import action inherits the styling from your Filament theme automatically. If you're experiencing styling conflicts, ensure that:

  1. Your Filament theme is properly configured
  2. The load_stylesheet config option is set to false (default)
  3. Your application's CSS doesn't have overly broad selectors that might conflict

Custom Styling

If you need custom styling for the Excel Import components, you can:

  1. Add CSS targeting the specific modal and form components
  2. Use Filament's theming system to customize the appearance
  3. Override specific component classes in your application's CSS

Troubleshooting

CSS Conflicts with [type="button"] selectors

If you're experiencing CSS conflicts where the Excel Import package is overriding your application's button styles, this is because the package was previously loading the full Filament theme CSS.

This has been resolved in the latest version by:

  1. Minimal CSS Loading: The package now loads only minimal CSS by default
  2. Configurable Stylesheet: You can enable/disable stylesheet loading via config
  3. Theme Integration: The package relies on your existing Filament theme

If you're still experiencing issues:

  1. Ensure you're using the latest version of the package
  2. Verify that load_stylesheet is set to false in your config (this is the default)
  3. Clear your browser cache and rebuild your assets

Migration from Previous Versions

If you're upgrading from a previous version that had CSS conflicts:

  1. Publish the config file: php artisan vendor:publish --tag=excel-import-config
  2. Ensure load_stylesheet is set to false
  3. Rebuild your assets: npm run build

All versions of filament-excel-import with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
filament/filament Version ^3.0
illuminate/contracts Version ^10.0|^11.0|^12.0
maatwebsite/excel Version ^3.1
spatie/laravel-package-tools Version ^1.15.0
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 eightynine/filament-excel-import contains the following files

Loading the files please wait ....