mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-15 19:09:50 +00:00
Expand bill API and v2 account API
This commit is contained in:
@@ -25,6 +25,10 @@ namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepository;
|
||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||
|
||||
use FireflyIII\Repositories\Administration\PiggyBank\PiggyBankRepository as AdminPiggyBankRepository;
|
||||
use FireflyIII\Repositories\Administration\PiggyBank\PiggyBankRepositoryInterface as AdminPiggyBankRepositoryInterface;
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -36,9 +40,7 @@ class PiggyBankServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
@@ -57,5 +59,17 @@ class PiggyBankServiceProvider extends ServiceProvider
|
||||
return $repository;
|
||||
}
|
||||
);
|
||||
|
||||
$this->app->bind(
|
||||
AdminPiggyBankRepositoryInterface::class,
|
||||
function (Application $app) {
|
||||
/** @var AdminPiggyBankRepository $repository */
|
||||
$repository = app(AdminPiggyBankRepository::class);
|
||||
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
|
||||
$repository->setUser(auth()->user());
|
||||
}
|
||||
return $repository;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user