Support the ongoing development of Laravel.io →
Database Eloquent

Hello, is there a way to easily do this? I tried this way:

http://laravelsnippets.com/snippets/seed-database-from-csv-file

but it doesn't work, I have a "model" table with an image column containing links and I think the method produces a mess.

example:

Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.";http://images.it.somestuff.com/media/catalog/product/cache/1' at line 1 (SQL: insert into models` ... bla bla bla

Probably this method doesn't specify all the info sql wants to consider a line as a single data. So, any effective way of converting a csv into a table seeder?

Last updated 2 years ago.
0

Post the first few lines from the CSV file you are trying to import. And the full text of the error.

0

You can use this app https://github.com/PejmanNik/ExcelToLaravelSeeder/blob/master/Win32/Release/Excel2LaravelSeeder.exe

just select excel file then set column name and the seeder will be generated

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

chriz74x chriz74x Joined 8 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.