in Laravel

How To Create A Facade In Laravel

In this tutorial we're going to learn how to use and create your own Laravel facades.

What Is A Facade?

A facade provides a static way of accessing the Laravel service container. The service container allows you to instaniate classes via an alias. You can access the service container by using the app() or resolve() helper functions, passing in the alias for the class you want to return.

$client = app('api-client');

You c

Login to access all content on Paulund

Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email