mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
First attempt at "create transaction"-form for v2 users.
This commit is contained in:
@@ -31,6 +31,8 @@ use FireflyIII\Repositories\Journal\JournalCLIRepository;
|
||||
use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepository;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use FireflyIII\Repositories\UserGroups\Journal\JournalRepository as GroupJournalRepository;
|
||||
use FireflyIII\Repositories\UserGroups\Journal\JournalRepositoryInterface as GroupJournalRepositoryInterface;
|
||||
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepository;
|
||||
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface;
|
||||
use Illuminate\Foundation\Application;
|
||||
@@ -44,9 +46,7 @@ class JournalServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
}
|
||||
public function boot(): void {}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
@@ -76,6 +76,19 @@ class JournalServiceProvider extends ServiceProvider
|
||||
}
|
||||
);
|
||||
|
||||
$this->app->bind(
|
||||
GroupJournalRepositoryInterface::class,
|
||||
static function (Application $app) {
|
||||
/** @var GroupJournalRepositoryInterface $repository */
|
||||
$repository = app(GroupJournalRepository::class);
|
||||
if ($app->auth->check()) { // @phpstan-ignore-line (phpstan does not understand the reference to auth)
|
||||
$repository->setUser(auth()->user());
|
||||
}
|
||||
|
||||
return $repository;
|
||||
}
|
||||
);
|
||||
|
||||
// also bind new API repository
|
||||
$this->app->bind(
|
||||
JournalAPIRepositoryInterface::class,
|
||||
|
Reference in New Issue
Block a user