1

I am trying to import an excel using Laravel with dynamically changing columns(names as well as sequence) . I am looking for a way to map these columns against Sql db columns.

1 Answer 1

1

Please share your code for clarification;

you can use this package to import and change dynamically in callback;

https://github.com/rap2hpoutre/fast-excel

$users = (new FastExcel)->import('file.xlsx', function ($line) {
    //here you can perform custom action on your data
    return User::create([
        'name' => $line['Name'],
        'email' => $line['Email']
    ]);
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.