PHPackages                             yuyu-tech/filament-import - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yuyu-tech/filament-import

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yuyu-tech/filament-import
=========================

1.0.0(3y ago)14MITPHPPHP ^8.0

Since Dec 12Pushed 3y agoCompare

[ Source](https://github.com/yuyu-tech/filament-import)[ Packagist](https://packagist.org/packages/yuyu-tech/filament-import)[ RSS](/packages/yuyu-tech-filament-import/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (17)Versions (2)Used By (0)

[![Screenshot of Login](./art/screenshot.png)](./art/screenshot.png)

Filament Plugin for Import CSV and XLS into Database
====================================================

[](#filament-plugin-for-import-csv-and-xls-into-database)

[ ![FILAMENT 2.x](https://camo.githubusercontent.com/ffb3946459ec228fbda7af8fcf67f328a4d0280773c1918dd63fc5658abfaf2b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f46494c414d454e542d322e782d454242333034)](https://filamentadmin.com/docs/2.x/admin/installation)[ ![Packagist](https://camo.githubusercontent.com/b98bb447b4098811d39563e1f4aa27abebf8f8f105d20298a4fa42c9e83edfef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f797579752d746563682f66696c616d656e742d696d706f72742e7376673f6c6f676f3d7061636b6167697374)](https://packagist.org/packages/yuyu-tech/filament-import)[ ![Downloads](https://camo.githubusercontent.com/adecb7824a24299fed792edf47f478e8d01a30dc0edddb1e9ed97fc7f76798e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f797579752d746563682f66696c616d656e742d696d706f72742e737667)](https://packagist.org/packages/yuyu-tech/filament-import)[![Code Styles](https://github.com/yuyu-tech/filament-import/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/yuyu-tech/filament-import/actions/workflows/php-cs-fixer.yml)[![run-tests](https://github.com/yuyu-tech/filament-import/actions/workflows/run-tests.yml/badge.svg)](https://github.com/yuyu-tech/filament-import/actions/workflows/run-tests.yml)

This package will make it easier for you to import from files to your model, very easily without the need to do templates.

all you have to do is drag and drop and match the fields and columns of your file, and let magic happens!

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require yuyu-tech/filament-import
```

Publishing Config
-----------------

[](#publishing-config)

If you want to do the settings manually, please publish the existing config.

```
php artisan vendor:publish --tag=filament-import-config
```

Usage
-----

[](#usage)

import the actions into `ListRecords` page

```
use YuyuTech\FilamentImport\Actions\ImportAction;
use YuyuTech\FilamentImport\Actions\ImportField;

class ListCredentialDatabases extends ListRecords
{
    protected static string $resource = CredentialDatabaseResource::class;

    protected function getActions(): array
    {
        return [
            ImportAction::make()
                ->fields([
                    ImportField::make('project')
                        ->label('Project')
                        ->helperText('Define as project helper'),
                    ImportField::make('manager')
                        ->label('Manager'),
                ])
        ];
    }
}
```

### Required Field

[](#required-field)

```
protected function getActions(): array
{
    return [
        ImportAction::make()
            ->fields([
                ImportField::make('project')
                    ->label('Project')
                    ->required(),
            ])
    ];
}
```

### Disable Mass Create

[](#disable-mass-create)

if you still want to stick with the event model you might need this and turn off mass create

```
protected function getActions(): array
{
    return [
        ImportAction::make()
            ->massCreate(false)
            ->fields([
                ImportField::make('project')
                    ->label('Project')
                    ->required(),
            ])
    ];
}
```

### Field Data Mutation

[](#field-data-mutation)

you can also manipulate data from row spreadsheet before saving to model

```
protected function getActions(): array
{
    return [
        ImportAction::make()
            ->fields([
                ImportField::make('project')
                    ->label('Project')
                    ->mutateBeforeCreate(fn($value) => Str::of($value)->camelCase())
                    ->required(),
            ])
    ];
}
```

otherwise you can manipulate data and getting all mutated data from field before its getting insert into the database.

```
protected function getActions(): array
{
    return [
        ImportAction::make()
            ->fields([
                ImportField::make('email')
                    ->label('Email')
                    ->required(),
            ])->mutateBeforeCreate(function($row){
                $row['password'] = bcrypt($row['email']);

                return $row;
            })
    ];
}
```

it is also possible to manipulate data after it was inserted into the database

```
use Illuminate\Database\Eloquent\Model;

protected function getActions(): array
{
    return [
        ImportAction::make()
            ->fields([
                ImportField::make('email')
                    ->label('Email')
                    ->required(),
            ])->mutateAfterCreate(function(Model $model, $row){
                // do something with the model

                return $model;
            })
    ];
}
```

### Grid Column

[](#grid-column)

Of course, you can divide the column grid into several parts to beautify the appearance of the data map

```
protected function getActions(): array
{
    return [
        ImportAction::make()
            ->fields([
                ImportField::make('project')
                    ->label('Project')
                    ->required(),
            ], columns:2)
    ];
}
```

### Json Format Field

[](#json-format-field)

We also support the json format field, which you can set when calling the `make` function and separate the name with a dot annotation

```
protected function getActions(): array
{
    return [
        ImportAction::make()
            ->fields([
                ImportField::make('project.en')
                    ->label('Project In English')
                    ->required(),
                ImportField::make('project.id')
                    ->label('Project in Indonesia')
                    ->required(),
            ], columns:2)
    ];
}
```

### Static Field Data

[](#static-field-data)

for the static field data you can use the common fields from filament

```
use Filament\Forms\Components\Select;

protected function getActions(): array
{
    return [
        ImportAction::make()
            ->fields([
                ImportField::make('name')
                    ->label('Project')
                    ->required(),
                Select::make('status')
                    ->options([
                        'draft' => 'Draft',
                        'reviewing' => 'Reviewing',
                        'published' => 'Published',
                    ])
            ], columns:2)
    ];
}
```

### Unique field

[](#unique-field)

if your model should be unique, you can pass the name of the field, which will be used to check if a row already exists in the database. if it exists, skip that row (preventing an error about non unique row)

```
use Filament\Forms\Components\Select;

protected function getActions(): array
{
    return [
        ImportAction::make()
            ->uniqueField('email')
            ->fields([
                ImportField::make('email')
                    ->label('Email')
                    ->required(),
            ], columns:2)
    ];
}
```

### Validation

[](#validation)

you can make the validation for import fields, for more information about the available validation please check laravel documentation

```
use Filament\Forms\Components\Select;

protected function getActions(): array
{
    return [
        ImportAction::make()
            ->fields([
                ImportField::make('name')
                    ->label('Project')
                    ->rules('required|min:10|max:255'),
            ], columns:2)
    ];
}
```

### Create Record

[](#create-record)

you can overide the default record creation closure and put your own code by using `handleRecordCreation` function

```
use Filament\Forms\Components\Select;

protected function getActions(): array
{
    return [
        ImportAction::make()
            ->fields([
                ImportField::make('name')
                    ->label('Project')
                    ->rules('required|min:10|max:255'),
            ], columns:2)
            ->handleRecordCreation(function($data){
                return Post::create($data);
            })
    ];
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/yuyu-tech/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1298d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c1759c295e679a657cef3bdfa12d0ac651a8dad1ebff780899f4a971e3a5928f?d=identicon)[merbhushan](/maintainers/merbhushan)

---

Top Contributors

[![merbhushan](https://avatars.githubusercontent.com/u/25707262?v=4)](https://github.com/merbhushan "merbhushan (1 commits)")

---

Tags

laravelimportfilament-import

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/yuyu-tech-filament-import/health.svg)

```
[![Health](https://phpackages.com/badges/yuyu-tech-filament-import/health.svg)](https://phpackages.com/packages/yuyu-tech-filament-import)
```

###  Alternatives

[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k90](/packages/nativephp-mobile)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[konnco/filament-import

242251.1k2](/packages/konnco-filament-import)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
