V
V
Vladislav2018-08-06 14:14:27
Laravel
Vladislav, 2018-08-06 14:14:27

How to read sql file in Larvel?

Hello.
SQL files are uploaded through the form to the admin panel. What is the right way to make Laravel read this file and create the tables that are written there?
Tried like this, but it constantly swears at \r\n

$file = File::find($id);
    $contents = Storage::get('public/BD/' . $file->url);
    DB::statement($contents);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question