In this example,I will learn you how to run sql file or query in laravel seeder.you can easy run sql file or query in laravel seeder.
In this example,I will create sql folder in public and store to sql file.you can bellow this code in your example.so first run bellow command for create "SqlFileSeeder" seeder.
First create a seeder file by artisan command.
Create Seeder :
php artisan make:seeder SqlFileSeeder
After run above command successfully, you will be found new created file database/seeds/SqlFileSeeder.php file and some sample data like as bellow:
class SqlFileSeeder extends Seeder
* Run the database seeds.
* @return void
public function run()
$path = public_path('sql/File.sql');
$sql = file_get_contents($path);
Now we are ready to run above seeder using bellow command:
php artisan db:seed --class=SqlFileSeeder
It will help you....