Downloads
Stars
Version
An Artisan command that generates a Service Provider and Facade based on your existing custom Service class file.
composer require prezire/facade-generator
php artisan make:facade [FacadeAliasName] [TargetServiceFile]
php artisan make:facade FooBar \\App\\Services\\Foo
You must register the generated provider and alias for the facade in `config/app.php' file.
'providers' => [
App\Providers\Facades\FooBarServiceProvider::class,
],
'aliases' => [
'FooBar' => App\Facades\FooBar::class,
],
Route::get('/', function () {
return \FooBar::doSomething();
});