mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-12 15:57:22 +00:00
Setup pint & run code style fix
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Http\Requests\ExchangeRateProviderRequest;
|
||||
use InvoiceShelf\Http\Resources\ExchangeRateProviderResource;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ExchangeRateProviderController extends Controller
|
||||
{
|
||||
@@ -56,7 +56,6 @@ class ExchangeRateProviderController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \InvoiceShelf\Models\ExchangeRateProvider $exchangeRateProvider
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(ExchangeRateProvider $exchangeRateProvider)
|
||||
@@ -70,7 +69,6 @@ class ExchangeRateProviderController extends Controller
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \InvoiceShelf\Models\ExchangeRateProvider $exchangeRateProvider
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(ExchangeRateProviderRequest $request, ExchangeRateProvider $exchangeRateProvider)
|
||||
@@ -97,7 +95,6 @@ class ExchangeRateProviderController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \InvoiceShelf\Models\ExchangeRateProvider $exchangeRateProvider
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(ExchangeRateProvider $exchangeRateProvider)
|
||||
|
||||
@@ -2,24 +2,23 @@
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\Currency;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GetActiveProviderController extends Controller
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function __invoke(Request $request, Currency $currency)
|
||||
{
|
||||
$query = ExchangeRateProvider::whereCompany()->whereJsonContains('currencies', $currency->code)
|
||||
->where('active', true)
|
||||
->get();
|
||||
->where('active', true)
|
||||
->get();
|
||||
|
||||
if (count($query) !== 0) {
|
||||
return response()->json([
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\CompanySetting;
|
||||
use InvoiceShelf\Models\Currency;
|
||||
use InvoiceShelf\Models\ExchangeRateLog;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
use InvoiceShelf\Traits\ExchangeRateProvidersTrait;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class GetExchangeRateController extends Controller
|
||||
{
|
||||
@@ -18,7 +18,6 @@ class GetExchangeRateController extends Controller
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function __invoke(Request $request, Currency $currency)
|
||||
@@ -27,14 +26,14 @@ class GetExchangeRateController extends Controller
|
||||
$baseCurrency = Currency::findOrFail($settings['currency']);
|
||||
|
||||
$query = ExchangeRateProvider::whereJsonContains('currencies', $currency->code)
|
||||
->where('active', true)
|
||||
->get()
|
||||
->toArray();
|
||||
->where('active', true)
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$exchange_rate = ExchangeRateLog::where('base_currency_id', $currency->id)
|
||||
->where('currency_id', $baseCurrency->id)
|
||||
->orderBy('created_at', 'desc')
|
||||
->value('exchange_rate');
|
||||
->where('currency_id', $baseCurrency->id)
|
||||
->orderBy('created_at', 'desc')
|
||||
->value('exchange_rate');
|
||||
|
||||
if ($query) {
|
||||
$filter = Arr::only($query[0], ['key', 'driver', 'driver_config']);
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
use InvoiceShelf\Traits\ExchangeRateProvidersTrait;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GetSupportedCurrenciesController extends Controller
|
||||
{
|
||||
@@ -14,7 +14,6 @@ class GetSupportedCurrenciesController extends Controller
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
|
||||
@@ -2,16 +2,15 @@
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
use InvoiceShelf\Models\ExchangeRateProvider;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GetUsedCurrenciesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Handle the incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user