database/seeders/ReversalSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $payment = Payment::all()->count();
        $status = ['processing', 'denied', 'approved'];
        for ($i=0; $i < 100; $i++) { 
            Reversal::create([
                'payment_id' => random_int(3, $payment),
                'status' => $status[array_rand($status)]
            ]);
        }
    }
public function run ( ) { $ payment = Payment :: all ( ) -> count ( ) ; $ status = [ 'processing' , 'denied' , 'approved' ] ; for ( $ i = 0 ; $ i < 100 ; $ i ++ ) { Reversal :: create ( [ 'payment_id' => random_int ( 3 , $ payment ) , 'status' => $ status [ array_rand ( $ status ) ] ] ) ; } }
Run the database seeds.
Run the database seeds .