<?php namespace Example\Facades;
use Illuminate\Support\Facades\Facade;
class ExampleFacade extends Facade {
protected static function getFacadeAccessor() { return 'example'; }
}
You can write a Facade class like this which has to implement the getFacadeAccessor() method. The string it returns is the string you have defined in your ServiceProvider and the Facade will "point" to the Object created from that string.
After that you need to register your Facade in config/app.php in the aliases array.
Can i get any example on how to create package and register facades for that package
i had used this tools http://packalyst.com/packages/package/xtwoend/workbench
but failed
Have a look at this great resource: http://www.websanova.com/blog/laravel/creating-a-new-package-in-laravel-5-part-1-package-workflow
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community