rainbow1997/backpack-import-with-utf8

1 2023-07-12 12:25 UTC

This package is auto-updated.

Last update: 2024-12-12 15:27:09 UTC


README

** THIS PROJECT IS FORKED FROM https://github.com/ckhandla94/backpack-import

Install

  1. This package assumes you've already installed Backpack for Laravel. If you haven't, please install Backpack first.

  2. In your terminal:

composer require ckhandla94/backpack-import
  1. Run its migrations. Most likely it's:
php artisan migrate

Usage in your controller

Here's a simple example to use in your controller:

...
class ExampleCrudController extends CrudController
{
    ...
    use \BackpackImport\ImportOperation;

    public function importValidationRules()
    {
        return [
            'category_id' => 'required|exists:categories,id',
            'name'        => 'required|max:255',
            'duration'    => 'nullable|numeric',
            'price'       => 'nullable|numeric',
            'image'       => 'nullable',
            'description' => 'nullable|max:5000',
            'status'      => 'required',
        ];
    }
    ....

Preview

Import button in List page

Screenshot-3

Import page or Download sample file

Screenshot-1

Preview of the uploaded file and Maping with database

Screenshot-3