PHPackages                             jameron/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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. jameron/import

ActiveProject[PDF &amp; Document Generation](/categories/documents)

jameron/import
==============

A simle package to assist with importing data via csv.

1.4.1(8y ago)065MITPHP

Since Dec 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jameron/import)[ Packagist](https://packagist.org/packages/jameron/import)[ Docs](http://cjmacfarlane.com)[ RSS](/packages/jameron-import/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (42)Used By (0)

This package has been built to work with Laravel 5.4.33 and later.

This package contains methods and traits that can be used with your project, and optionally you can use the views or just the view parials for your UX. If you are using the upload view, make sure you also require the admin package found here: [Admin package](https://github.com/jameron/admin)

Your composer file would look like so:

```
        "jameron/admin": "*",
        "jameron/import": "*",
```

Some older versions may not be compatible. Let's see if we can't get you up and running in 10 steps. If you are starting fresh, create your laravel application first thing:

```
    composer create-project --prefer-dist laravel/laravel blog
```

1. Add the package to your compose.json file:

```
    "jameron/import": "*",
```

```
composer update
```

\*\*NOTE Laravel 5.5+ users there is auto-discovery so you can ignore steps 2 and 3

2. Update your providers:

```
        Jameron\Regulator\ImportsServiceProvider::class,
```

3. Update your Facades:

```
        'Imports' => Jameron\Regulator\Facades\ImportsFacade::class,
```

4. Publish the views and config:

```
php artisan vendor:publish
```

5. (Only if using Regulator for roles and permissions) Seed the database with import permission and assign permission to admin role

You can call it directly via command line or add it to your applications seeder file:

Added to application seeder

`database/seeds/DatabaseSeeder.php`

```
$this->call(\Jameron\Import\database\seeds\ImportSeeder::class);
```

Called via command line:

```
php artisan db:seed --class=\\Jameron\\Import\\database\\seeds\\ImportSeeder
```

6. Update your webpack.mix.js file

```
   .js('resources/assets/import/js/upload.js', 'public/js/Upload.js')
   .sass('resources/assets/import/sass/upload.scss', 'public/css')
```

7. Compile it up:

```
npm run dev
```

8. Setup your routes and controllers

```
Route::group(['middleware' => ['web', 'auth', 'role:admin']], function () {
    Route::get('/import', 'ImportController@getImport');
    Route::post('/import', 'ImportController@postImport');
});
```

```
use \Jameron\Import\Http\Requests\ImportRequest;

class ImportController extends Controller
{

    public function getImport()
    {
        return view('import::upload');
    }

    public function postImport(ImportRequest $request)
    {
        $csv = $request->file('csv');
        $headers_cleanup_rules = ['trim','pound_to_word_number','spaces_to_underscores', 'remove_special_characters','lowercase'];
        $import_model = \App\Models\QuizScores::class;
        $validator = \App\Http\Requests\QuizScoreRequest::class;

        $relationships = [
            [
                'create_if_not_found' => true,
                'csv_column' => 'student_id',
                'reference_table' => 'users',
                'reference_field' => 'student_identification_number',
                'reference_primary_key' => 'id',
                'foreign_key' => 'student_id',
                'relationship' => 'belongsTo',
                'model' => \App\Models\User::class,
                'validator' => \App\Http\Requests\UserRequest::class,
                'roles' => ['student'], // this only works for new users with the regulator package installed
                'extra_columns' => [
                    [
                        'column' => 'student_name',
                        'maps_to' => ['first_name','last_name'],
                        'explode_on' => ' '
                    ],
                    [
                        'column' => 'email',
                        'maps_to' => 'email',
                    ]
                ],
                'append_data' => [
                    'password' => \Hash::make('ChangeIt!')
                ]
            ],
            [
                'csv_column' => 'test_name',
                'reference_table' => 'tests',
                'reference_field' => 'name', // This assumes that the name field on the tests table has a rule that forces unique
                'reference_primary_key' => 'id',
                'foreign_key' => 'test_id',
                'model' => \App\Models\Tests::class,
                'validator' => \App\Http\Requests\TestRequest::class,
            ]
        ];

    }

}
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity75

Established project with proven stability

 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

Every ~1 days

Total

41

Last Release

3078d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1240f858b81e0d846cb4423a5ae9bea96360ae98d4e91506c9c097cfd69698e3?d=identicon)[Jameron](/maintainers/Jameron)

---

Top Contributors

[![Jameron](https://avatars.githubusercontent.com/u/2600629?v=4)](https://github.com/Jameron "Jameron (49 commits)")

---

Tags

csvimport

### Embed Badge

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

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

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k152.8M852](/packages/maatwebsite-excel)[league/csv

CSV data manipulation made easy in PHP

3.5k176.5M807](/packages/league-csv)[goodby/csv

CSV import/export library

9535.6M25](/packages/goodby-csv)[avadim/fast-excel-reader

Lightweight and very fast XLSX Excel Spreadsheet and CSV Reader in PHP

106693.8k9](/packages/avadim-fast-excel-reader)[ddeboer/data-import-bundle

A Symfony2 bundle for the ddeboer/data-import library

681.3M1](/packages/ddeboer-data-import-bundle)[handcraftedinthealps/goodby-csv

CSV import/export library

441.7M7](/packages/handcraftedinthealps-goodby-csv)

PHPackages © 2026

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