1 year ago

Does alias work only work in view templates?

Posted 1 year ago by resting

I have a Facade class:

namespace App\Facades;

use Illuminate\Support\Facades\Facade;

class VuforiaApiFacade extends Facade
    protected static function getFacadeAccessor()
        return 'VuforiaApi';

I register the alias VuforiaApi with:

'VuforiaApi' => App\Facades\VuforiaApiFacade::class,

Tried to call a method from controller:


throws Class 'App\Http\Controllers\VuforiaApi' not found

I had to call the full path to the Facade:

use App\Facades\VuforiaApiFacade;

However calling a method in view template works fine


So alias only works in view templates?

Please sign in or create an account to participate in this conversation.