diff --git a/composer.json b/composer.json index 7a184a3..8c8b156 100644 --- a/composer.json +++ b/composer.json @@ -48,6 +48,11 @@ "extra": { "branch-alias": { "dev-master": "3.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Forge\\ForgeServiceProvider" + ] } }, "config": { diff --git a/src/Facades/Forge.php b/src/Facades/Forge.php new file mode 100644 index 0000000..3e5618f --- /dev/null +++ b/src/Facades/Forge.php @@ -0,0 +1,22 @@ +forge = new Forge($token); + } + + /** + * Dynamically pass methods to the Forge instance. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call(string $method, array $parameters): mixed + { + return $this->forwardCallTo($this->forge, $method, $parameters); + } +} diff --git a/src/ForgeServiceProvider.php b/src/ForgeServiceProvider.php new file mode 100644 index 0000000..53e6de6 --- /dev/null +++ b/src/ForgeServiceProvider.php @@ -0,0 +1,19 @@ +app->singleton(ForgeManager::class, function ($app) { + return new ForgeManager($app['config']->get('services.forge.token')); + }); + } +}