Support the ongoing development of →
IOC Packages
Last updated 2 years ago.
<?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

but failed

Last updated 8 years ago.

Sign in to participate in this thread!


Your banner here too?

mukeshp004 mukeshp004 Joined 23 Jun 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.