Páginas · Laravilt
ImportAction
Import records from XLSX or CSV files with Laravel Excel.
ImportAction opens a modal with a file upload and runs a Laravel Excel import class.
php
Defaults: name import, label "Import", icon upload, color gray. Accepted file types are .xls, .xlsx, and .csv.
Generate an importer
bash
This creates app/Imports/ProductImporter.php, a Laravel Excel import class (ToModel, WithHeadingRow, WithValidation, SkipsEmptyRows). Map each row in model() and validate it in rules().
File type
php
Hooks
Both callbacks receive the uploaded file:
php
Queued imports
php
API reference
| Method | Description |
|---|---|
importer(string) | Laravel Excel import class |
xlsx(), csv(), readerType(string) | Input format |
acceptedFileTypes(array) | Allowed MIME types |
beforeImport(Closure), afterImport(Closure) | Hooks |
queue(), disk(), chunkSize(int) | Queued imports |