PHPackages                             mellojoaoaus/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. mellojoaoaus/filament-import

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

mellojoaoaus/filament-import
============================

1.6.4(9mo ago)078MITPHPPHP ^8.2|^8.3

Since May 3Pushed 9mo agoCompare

[ Source](https://github.com/mellojoaoaus/filament-import)[ Packagist](https://packagist.org/packages/mellojoaoaus/filament-import)[ RSS](/packages/mellojoaoaus-filament-import/feed)WikiDiscussions filament3 Synced 2d ago

READMEChangelog (4)Dependencies (17)Versions (5)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/8ddc4ba9e2d4be60d7db6793ccc514fee225413eb7099ef9a19c8450b9e2b9d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6f6e6e636f2f66696c616d656e742d696d706f72742e7376673f6c6f676f3d7061636b6167697374)](https://packagist.org/packages/konnco/filament-import)[ ![Downloads](https://camo.githubusercontent.com/54a0148d35e259de9fb61029110d97731a0402eb7c0d6afafa74863409b442e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6f6e6e636f2f66696c616d656e742d696d706f72742e737667)](https://packagist.org/packages/konnco/filament-import)[![Code Styles](https://github.com/konnco/filament-import/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/konnco/filament-import/actions/workflows/php-cs-fixer.yml)[![run-tests](https://github.com/konnco/filament-import/actions/workflows/run-tests.yml/badge.svg)](https://github.com/konnco/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 konnco/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 Konnco\FilamentImport\Actions\ImportAction;
use Konnco\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(),
            ])
    ];
}
```

### Filter Out Blank Rows

[](#filter-out-blank-rows)

If you have a spreadsheet which includes blank data [click here to see more](https://thesoftwarepro.com/excel-tips-how-to-fill-blank-cells/), you can filter these out:

```
protected function getActions(): array
{
    return [
        ImportAction::make()
            ->handleBlankRows(true)
            ->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/konnco/.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

37

—

LowBetter than 81% of packages

Maintenance56

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.5% 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

Every ~179 days

Total

4

Last Release

293d ago

PHP version history (2 changes)1.6.1PHP ^8.0

1.6.4PHP ^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cf80e0467fe9767bfb173f1eca0a10e735724072ad0db110f791c1e341f2e82?d=identicon)[mellojoaoaus](/maintainers/mellojoaoaus)

---

Top Contributors

[![frankyso](https://avatars.githubusercontent.com/u/5705520?v=4)](https://github.com/frankyso "frankyso (136 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")[![mellojoaoaus](https://avatars.githubusercontent.com/u/57524152?v=4)](https://github.com/mellojoaoaus "mellojoaoaus (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![adriaardila](https://avatars.githubusercontent.com/u/2029010?v=4)](https://github.com/adriaardila "adriaardila (6 commits)")[![arjen-mediasoep](https://avatars.githubusercontent.com/u/122452581?v=4)](https://github.com/arjen-mediasoep "arjen-mediasoep (3 commits)")[![Saifallak](https://avatars.githubusercontent.com/u/6053156?v=4)](https://github.com/Saifallak "Saifallak (2 commits)")[![rizkyanfasafm](https://avatars.githubusercontent.com/u/24226461?v=4)](https://github.com/rizkyanfasafm "rizkyanfasafm (2 commits)")[![ster](https://avatars.githubusercontent.com/u/59856?v=4)](https://github.com/ster "ster (2 commits)")[![tiagof](https://avatars.githubusercontent.com/u/1729910?v=4)](https://github.com/tiagof "tiagof (2 commits)")[![archilex](https://avatars.githubusercontent.com/u/6097099?v=4)](https://github.com/archilex "archilex (2 commits)")[![byt3sage](https://avatars.githubusercontent.com/u/61322528?v=4)](https://github.com/byt3sage "byt3sage (2 commits)")[![alex552](https://avatars.githubusercontent.com/u/21161486?v=4)](https://github.com/alex552 "alex552 (2 commits)")[![tryoasnafi](https://avatars.githubusercontent.com/u/61939827?v=4)](https://github.com/tryoasnafi "tryoasnafi (1 commits)")[![jeffersonGlemos](https://avatars.githubusercontent.com/u/8877254?v=4)](https://github.com/jeffersonGlemos "jeffersonGlemos (1 commits)")[![mtawil](https://avatars.githubusercontent.com/u/700753?v=4)](https://github.com/mtawil "mtawil (1 commits)")[![abduromanov](https://avatars.githubusercontent.com/u/37548312?v=4)](https://github.com/abduromanov "abduromanov (1 commits)")

---

Tags

laravelimportfilament-import

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[backstage/mails

View logged mails and events in a beautiful Filament UI.

16429.7k](/packages/backstage-mails)[tapp/filament-form-builder

User facing form builder using Filament components

133.5k6](/packages/tapp-filament-form-builder)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[marcelweidum/filament-expiration-notice

Customize the livewire expiration notice

94160.6k6](/packages/marcelweidum-filament-expiration-notice)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

604.0k2](/packages/crumbls-layup)

PHPackages © 2026

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