-- Laravel

How To Create Facade On Laravel 5.2

Here is step by step to create facade on laravel 5.2

Create PHP Class File.

Bind that class to Service Provider

Register that ServiceProvider to Config\app.php as providers

Create Class which is this class extends to Illuminate\Support\Facades\Facade

Register point 4 to Config\app.php as aliases
Step 1 – Create PHP Class File, for example in App\Classes\Someclass.php

Step 2 – Bind that class to Service Provider

In case i create a new serviceprovider by execute

then add

Like so

Step 3 – Register that ServiceProvider to Config\app.php as providers

Step 4 – Create Class which is this class extends to Illuminate\Support\Facades\Facade

For Example I create this class in App\Facades\Someclass.php

Step 5 – Register point 4 to Config\app.php as aliases

Testing
On App\Http\routes.php create single route

Then check on your browser

593 Total 1 Today