I'm trying to seed into an orders migration file, however upon using the command: php artisan migrate:refresh --seed, the following error is being returned.
ReflectionException : Class OrdersTableSeeder does not exist
Either I'm stupid or Laravel is broken.
Seeder:
class OrdersTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('orders')->insert([
'user_id' => 1,
'product_id' => 1,
'quantity' => 10,
'updated_at' => DB::raw('CURRENT_TIMESTAMP')
]);
DB::table('orders')->insert([
'user_id' => 1,
'product_id' => 2,
'quantity' => 5,
'updated_at' => DB::raw('CURRENT_TIMESTAMP')
]);
}
}
Migration:
Schema::create('orders', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('user_id'); //fk
$table->integer('product_id'); //fk
$table->integer('quantity');
$table->timestamps();
});