0

I'm relatively new at Laravel development and I have a large .sql file to add on my existing db (the DB is a list of city in Italy with their relative lat and long data). Anyone know how can I add the file with a seed? thank you and sorry for the question :)

1

1 Answer 1

1

To add a .sql file with a seed, you have to use the following approach:

DB::unprepared(file_get_contents(database_path('seeds/cities.sql'));

This will not work well with very large files.

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.