exportJob(); $this->importJob(); } /** * */ private function exportJob() { $this->app->bind( ExportJobRepositoryInterface::class, function (Application $app) { /** @var ExportJobRepository $repository */ $repository = app(ExportJobRepository::class); if ($app->auth->check()) { $repository->setUser(auth()->user()); } return $repository; } ); } private function importJob() { $this->app->bind( 'FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface', function (Application $app, array $arguments) { if (!isset($arguments[0]) && $app->auth->check()) { return app('FireflyIII\Repositories\ImportJob\ImportJobRepository', [auth()->user()]); } if (!isset($arguments[0]) && !$app->auth->check()) { throw new FireflyException('There is no user present.'); } return app('FireflyIII\Repositories\ImportJob\ImportJobRepository', $arguments); } ); } }