mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Expand API with v2 summary endpoint.
This commit is contained in:
@@ -25,6 +25,8 @@ namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Repositories\Bill\BillRepository;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Repositories\Administration\Bill\BillRepository as AdminBillRepository;
|
||||
use FireflyIII\Repositories\Administration\Bill\BillRepositoryInterface as AdminBillRepositoryInterface;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -59,5 +61,21 @@ class BillServiceProvider extends ServiceProvider
|
||||
return $repository;
|
||||
}
|
||||
);
|
||||
|
||||
// administration variant
|
||||
$this->app->bind(
|
||||
AdminBillRepositoryInterface::class,
|
||||
function (Application $app) {
|
||||
/** @var AdminBillRepositoryInterface $repository */
|
||||
$repository = app(AdminBillRepository::class);
|
||||
|
||||
// reference to auth is not understood by phpstan.
|
||||
if ($app->auth->check()) { // @phpstan-ignore-line
|
||||
$repository->setUser(auth()->user());
|
||||
}
|
||||
|
||||
return $repository;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user