mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix missing initialisation
This commit is contained in:
@@ -27,6 +27,8 @@ use FireflyIII\Repositories\Currency\CurrencyRepository;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepository as GroupCurrencyRepository;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface as GroupCurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepository;
|
||||
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -72,5 +74,19 @@ class CurrencyServiceProvider extends ServiceProvider
|
||||
}
|
||||
);
|
||||
|
||||
$this->app->bind(
|
||||
ExchangeRateRepositoryInterface::class,
|
||||
static function (Application $app) {
|
||||
/** @var ExchangeRateRepository $repository */
|
||||
$repository = app(ExchangeRateRepository::class);
|
||||
// phpstan does not get the reference to auth
|
||||
if ($app->auth->check()) { // @phpstan-ignore-line
|
||||
$repository->setUserGroup(auth()->user()->userGroup);
|
||||
}
|
||||
|
||||
return $repository;
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user