diff --git a/src/Helpers/helpers.php b/src/Helpers/helpers.php index 3c60643..f50b666 100644 --- a/src/Helpers/helpers.php +++ b/src/Helpers/helpers.php @@ -4,6 +4,7 @@ use MichaelRubel\EnhancedContainer\Call; use MichaelRubel\EnhancedContainer\Core\BindingBuilder; +use MichaelRubel\EnhancedContainer\Core\CallProxy; if (! function_exists('call')) { /** @@ -15,7 +16,7 @@ */ function call(string|object $class, array $parameters = [], ?string $context = null): mixed { - return app(Call::class, [$class, $parameters, $context]); + return new CallProxy($class, $parameters, $context); } } diff --git a/src/LecServiceProvider.php b/src/LecServiceProvider.php index 42381c8..5c1cc2e 100644 --- a/src/LecServiceProvider.php +++ b/src/LecServiceProvider.php @@ -4,7 +4,6 @@ namespace MichaelRubel\EnhancedContainer; -use MichaelRubel\EnhancedContainer\Core\CallProxy; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; @@ -23,22 +22,4 @@ public function configurePackage(Package $package): void ->name('laravel-enhanced-container') ->hasConfigFile(); } - - /** - * Register any package services. - * - * @return void - */ - public function packageBooted(): void - { - $this->app->bind( - Call::class, - fn ($app, $params) - => new CallProxy( - current($params), - next($params), - end($params) - ) - ); - } }