Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Nicola Malizia:
Understanding Laravel’s Automatic Facades
Mar 27, 2017 @ 14:24:36

On his Unnikked site Nicola Malizia has written up a post sharing some insight into how Laravel's automatic facades work, a feature that was introduced in Laravel v5.4.

Another cool feature shipped with the release of Laravel 5.4 is the ability to use Facades on the fly. Automatic Facades with the official documentation is quite informative. So I assume you are familiar with them.

He then starts in on the creation of custom facades: defining the functionality (a class), creating the facade and updating the app config to load it in. He then covers what's happening behind the scenes when the "Facades" namespace is loaded and the facade is called (lots of code snippets included here).

My suggestion is to start using automatic facades whenever is possible, their impact is negligible. To see when to use facades in general a good read is available in the official documentation.
tagged: laravel automatic facade tutorial introduction

Link: https://unnikked.ga/understanding-laravels-automatic-facades-d623e4774e5f#.hi2vq6igs


Trending Topics: