PHPackages                             clean-code-studio/laravel-make-facades - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. clean-code-studio/laravel-make-facades

ActiveLibrary[CLI &amp; Console](/categories/cli)

clean-code-studio/laravel-make-facades
======================================

Laravel Artisan Command To Generate Facades (php artisan make generator now execpts facade Facadename)

1.0.6(6y ago)14.6kMITPHP ^7.1.3

Since Oct 26Pushed 4y agoCompare

[ Source](https://github.com/clean-code-studio/laravel-make-facades)[ Packagist](https://packagist.org/packages/clean-code-studio/laravel-make-facades)[ RSS](/packages/clean-code-studio-laravel-make-facades/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (10)Used By (0)

Laravel - Make Facades Package
------------------------------

[](#laravel---make-facades-package)

1. [Installation](#installation)
2. [Publish Package via Artisan](#publish-package-via-artisan)
3. [Configure Package Settings](#configure-package-settings)
4. [Use Make Facades Service](#use-make-facades-service)
5. [Laravel Make Facades Youtube Tutorial](#laravel-make-facades-youtube-tutorial)
6. [In Closing](#in-closing)

**Youtube Tutorial For This Package**[![Clean Code Studio Talking About Laravel Facades and Laravel Make Facades Package Tutorial](https://camo.githubusercontent.com/00c12d34e941935a04c748fb56426f5a7f841a8b36faef17fa7f747d248d17a3/687474703a2f2f696d672e796f75747562652e636f6d2f76692f476f304a42543938754f772f302e6a7067)](https://youtu.be/Go0JBT98uOw?t=380)

Laravel Make Facades (Simplified Package Tutorial)

Installation
------------

[](#installation)

---

**Comoser Install**

```
composer require clean-code-studio/laravel-make-facades --dev
```

Publish Package via Artisan
---------------------------

[](#publish-package-via-artisan)

**Publish Configuration File**

- `php artisan vendor:publish`
- Select `CleanCodeStudio\MakeFacades\ServiceProvider`

Configure Package Settings
--------------------------

[](#configure-package-settings)

**Define Config Settings**

- Open `config/make-facades.php`
    - **Note:** `config/make-facades.php` is created during the previous step when we publish this package via artisan
- Configure `config/make-facades.php` settings
    - **Path:** Facades folder path (where new facades created using this package will be stored)
    - **Namespace:** Namespace for every facade created using this package
    - **Providers Path:** Updated to support Laravel 8 release (See @see [zhorton34#4](https://github.com/zhorton34/laravel-make-facades/issues/4))
    - **Auto Alias Facades:** Whether you want to automatically bind all services within a given folder to its own Facade automatically.

**Laravel Make Facades - Config Settings**

- **File Path:** `config/make-facade.php example`

```
return [
   // Directory path save your facades
   'path' => 'app/facades',

  // Namespace Of Your Facades
  'namespace' => 'App\\Facades',

  // Providers path (@see https://github.com/zhorton34/laravel-make-facades/issues/4)
  'providers_path' => 'app/Providers',

  // This will find all of the aliases and services defined in your path settings and
  // 1. Bind the service classes for each facade to the service container automatically
  // 2. Register aliases for each facade base on the Class Name the Facade Reference to the service container automatically
  'auto_alias_facades' => true,
];
```

Use Make Facades Service
------------------------

[](#use-make-facades-service)

1. Run: `php artisan make:facade MyCoolService`
    - Creates Scaffold for `MyCoolService` class
    - Creates Scaffold for `MyCoolServiceFacade` class
    - **Note:**
    - If `'auto_alias_facades' => true` in `config/make-facade.php` then the service will automatically be binded to your service container
    - If `'auto_alias_facades' => false` in `config/make-facade.php` then you need to bind your generated service class to the service container in any service provider for the facade to properly work.

**MyCoolService Class**

- By Default created to `App\Facades\MyCoolService\MyCoolService.php`

```
