prezire/facade-generator

An Artisan command that generates a Service Provider and Facade based on your existing custom Service class file.

Downloads

30

Stars

0

Version

Facade Generator for Laravel 5.6

An Artisan command that generates a Service Provider and Facade based on your existing custom Service class file.


Installation

composer require prezire/facade-generator

Usage

php artisan make:facade [FacadeAliasName] [TargetServiceFile]

Example: Create a FooBar facade based on Foo service class file.

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,
],

Using the Facade.

Route::get('/', function () {
  return \FooBar::doSomething();
});
prezire

Author

prezire