Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2023_02_17_100000_vat_rates_table.php
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | public function up() | ||||
DB::table('payments')->whereIn('wallet_id', function ($query) use ($country) { | DB::table('payments')->whereIn('wallet_id', function ($query) use ($country) { | ||||
$query->select('id') | $query->select('id') | ||||
->from('wallets') | ->from('wallets') | ||||
->whereIn('user_id', function ($query) use ($country) { | ->whereIn('user_id', function ($query) use ($country) { | ||||
$query->select('user_id') | $query->select('user_id') | ||||
->from('user_settings') | ->from('user_settings') | ||||
->where('key', 'country') | ->where('key', 'country') | ||||
->where('value', $country); | ->where('value', $country); | ||||
}); | }); | ||||
}) | }) | ||||
->update(['vat_rate_id' => $vatRate->id]); | ->update(['vat_rate_id' => $vatRate->id]); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Reverse the migrations. | * Reverse the migrations. | ||||
Show All 17 Lines |