Create a class, add the Service Provider and try calling a method, for example, "test ()" and it works. Next I create a facade in "app / Facades / MyClass.php":
<?php
namespace App\Facades;
use Illuminate\Support\Facades\Facade;
class MyClase extends Facade {
protected static function getFacadeAccessor()
{
//return 'mc';
//return 'MC';
return 'mC';
}
} //class
Other tests have been commented on to return the name of the facade to be used. ..
In "config / app.php", in the "aliases" array I have:
'MC' => App\Facades\MyClase::class,
Try calling it on "routes.php":
Route::get( 'mc-facade', function() {
MC::test();
});
and in a controller ...
I have the following error message:
FatalThrowableError in Facade.php line 216: Fatal error: Call to undefined method App \ Facades \ MyClass :: test ()
Testing in local with Xampp / Windows.