. */ declare(strict_types=1); namespace FireflyIII\Providers; use FireflyIII\Repositories\LinkType\LinkTypeRepository; use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; /** * @codeCoverageIgnore * Class AdminServiceProvider */ class AdminServiceProvider extends ServiceProvider { /** * Bootstrap the application services. */ public function boot(): void { } /** * Register the application services. */ public function register(): void { $this->linkType(); } /** * Register link type repository */ private function linkType(): void { $this->app->bind( LinkTypeRepositoryInterface::class, function (Application $app) { /** @var LinkTypeRepository $repository */ $repository = app(LinkTypeRepository::class); if ($app->auth->check()) { $repository->setUser(auth()->user()); } return $repository; } ); } }