database/seeds/PrestamoImageTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        PrestamoImage::truncate();
        $Prestamos = Prestamo::all();
        foreach($Prestamos as $key => $p){
            PrestamoImage::create([
                    'image' => "1626209036.png",
                    'prestamo_id' => $p->id,
                ]);
        }
    }
public function run ( ) { PrestamoImage :: truncate ( ) ; $ Prestamos = Prestamo :: all ( ) ; foreach ( $ Prestamos as $ key => $ p ) { PrestamoImage :: create ( [ 'image' => " 1626209036.png " , 'prestamo_id' => $ p -> id , ] ) ; } }
Run the database seeds.
Run the database seeds .