prezire/facade-generator

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

Installs: 30

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/prezire/facade-generator

dev-master 2019-10-26 00:36 UTC

This package is auto-updated.

Last update: 2025-09-26 13:26:43 UTC


README

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();
});