Duy Dinh - 2016-03-23

How To Create Facade On Laravel 5.1
Posted on 9 months ago

Here is step by step to create facade on laravel 5.1

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

App\Facades\Someclass::class Testing On App\Http\routes.php create single route Route::get('/', function(){ Someclass::get(); }); Then check on your browser ?>