database/seeders/ProductSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $user = User::where("name", "Hema")->first();
            DB::table('products')->insert([
                'prod_name' => "Sounder",
                'prod_price' => 2000,
                'user_id' =>$user->id,
            ]);
    }
public function run ( ) { $ user = User :: where ( " name " , " Hema " ) -> first ( ) ; DB :: table ( 'products' ) -> insert ( [ 'prod_name' => " Sounder " , 'prod_price' => 2000 , 'user_id' => $ user -> id , ] ) ; }
Run the database seeds.
Run the database seeds .