Unable to import database upload from database using artisan . However, you can create a custom artisan command:
php artisan make:console DbImportCommand
and then run a command like:
DB::unprepared(file_get_contents('full/path/to/dump.sql'));
However, it can be useful to create a command that starts the seeder (or a set of seeders).
php artisan make:console importHistoricalData
and then do the following seeders:
$this->call(OldCompanySeeder::class); $this->call(OldEmployeeSeeder::class); // etc....
If you wipe the database at some point or move into a new environment, it will be as easy as just starting the seeders again.
source share