database/seeders/PaymentMethodSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        if (!PaymentMethod::where('name', 'COD')->first()) {
            PaymentMethod::create([
                'name' => 'COD',
                'status' => 1,
            ]);
        }
        if (!PaymentMethod::where('name', 'card')->first()) {
            PaymentMethod::create([
                'name' => 'card',
                'status' => 1,
            ]);
        }
    }
public function run ( ) { if ( ! PaymentMethod :: where ( 'name' , 'COD' ) -> first ( ) ) { PaymentMethod :: create ( [ 'name' => 'COD' , 'status' => 1 , ] ) ; } if ( ! PaymentMethod :: where ( 'name' , 'card' ) -> first ( ) ) { PaymentMethod :: create ( [ 'name' => 'card' , 'status' => 1 , ] ) ; } }
Run the database seeds.
Run the database seeds .