new CrmService( $app->make(CrmApiV4::class), $app->make(Repository::class), )); App::bind(CrmCustomerGatewayService::class, fn (Application $app): CrmCustomerGatewayService => $app->make(CrmService::class)); Auth::provider(CrmUserProvider::class, function (Application $app, array $config) { $hasher = $app->make(Hasher::class); $crmService = $app->make(CrmService::class); $model = Arr::string($config, 'model'); Assert::classExists($model); Assert::implementsInterface($model, Authenticatable::class); Assert::subclassOf($model, Model::class); return new CrmUserProvider($hasher, $model, $crmService); }); } }