Currency controller currency method #mvb7xp
This commit is contained in:
parent
48e3d8d7f2
commit
430f0e3372
@ -226,25 +226,6 @@ class Currencies extends Controller
|
||||
return response()->json($response);
|
||||
}
|
||||
|
||||
public function currency()
|
||||
{
|
||||
$json = new \stdClass();
|
||||
|
||||
$code = request('code');
|
||||
|
||||
if ($code) {
|
||||
// Get currency object
|
||||
$currency = Currency::where('code', $code)->first();
|
||||
|
||||
// it should be integer for amount mask
|
||||
$currency->precision = (int) $currency->precision;
|
||||
|
||||
$json = (object) $currency;
|
||||
}
|
||||
|
||||
return response()->json($json);
|
||||
}
|
||||
|
||||
public function config()
|
||||
{
|
||||
$json = new \stdClass();
|
||||
|
@ -154,8 +154,7 @@ Route::group(['prefix' => 'settings'], function () {
|
||||
Route::get('categories/export', 'Settings\Categories@export')->name('categories.export');
|
||||
Route::resource('categories', 'Settings\Categories');
|
||||
|
||||
Route::get('currencies/currency', 'Settings\Currencies@currency');
|
||||
Route::get('currencies/config', 'Settings\Currencies@config');
|
||||
Route::get('currencies/config', 'Settings\Currencies@config')->name('currencies.config');
|
||||
Route::get('currencies/{currency}/enable', 'Settings\Currencies@enable')->name('currencies.enable');
|
||||
Route::get('currencies/{currency}/disable', 'Settings\Currencies@disable')->name('currencies.disable');
|
||||
Route::resource('currencies', 'Settings\Currencies');
|
||||
|
Loading…
x
Reference in New Issue
Block a user