Tag: create a facades

Laravel Our Own Facades

Create and Use Custom Facades in Laravel

Lets create a class called Test class Test{ public function testfunction(){ return ‘testfunctioning’; } public function test2() { return ‘testing2’; } } And bind the class . app()->bind(‘Test’,function (){     return new Test(); }); Create a new TestFacade class. class TestFacade { public static function __callStatic($name,$args){ //app()->make and resolve are same // return app()->make(‘fish’)->$name(); return […]

Back To Top