I'm struggling to create a similar function but currently I have the following function:
//$amount (int) (anything from 10000 - 1000000)
//$platform (string) (XBOX or PS)
private function getPrice($platform, $amount) {
$price = DB::table('platform_prices')->where('platform', $platform)->first();
return $amount / 10000 * $price->price_per_10k;
}
This basically gets the price of a currency for a specified platform (which is stored in the DB based on per 10,000 currency).
As an example:
return $this->getPrice('XBOX', '50000'); //3.50
How can I create the same function but accepting the 3.50 as a value for $amount
& have it return 50000.