kevin-mitchell / alexa-app

Set of classes to make creating Amazon Alexa Skills Kit (ASK) applications easier with Laravel and Lumen
MIT License
97 stars 47 forks source link

Facades/Aliases do not work? (Laravel 5.5) #49

Closed helmuto closed 6 years ago

helmuto commented 6 years ago

hi,

i am using: "laravel/installer": "^2.0" "php": ">=7.0.0", "develpr/alexa-app": "^0.3.5", "fideloper/proxy": "~3.3", "laravel/framework": "5.5.*", "laravel/tinker": "~1.0"

I configured everything according to the Readme and it partly works.

In config/web.php:

WORKS: AlexaRoute::intent('/alexa-end-point', 'TestIntent', function(){ return Alexa::say("Hello World!"); });

DOES NOT WORK: AlexaRoute::intent('/alexa-end-point', 'TestIntent', 'App\Http\Controllers\AlexaController@alexaIntent');

Error message in storage/log/laravel.log: [2018-02-05 16:33:00] local.ERROR: Class 'App\Http\Controllers\Alexa' not found {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Class 'App\Http\Controllers\Alexa' not found at /data/web/e10622/html/alexa/test/app/Http/Controllers/AlexaController.php:14)

my full AlexaController.php: <?php namespace App\Http\Controllers; class AlexaController extends Controller { public function alexaIntent() { return Alexa::say('Hello World!'); } }

It seems that the Facades/Aliases do not work. I downloaded the alexa-sdk with composer in the root folder of laravel. So everything is under vendor/develpr/alexa-app/... And i entered the aliases+providers in the config/app.php according to the Readme.

Any idea whats the problem with my installation? Would be great if you could point me in the right direction - i tried a lot of things but nothing seems to fix that problem.

thanks and br, Helmut

wertmenschen commented 6 years ago

Same as https://github.com/develpr/alexa-app/issues/46

helmuto commented 6 years ago

yes - adding "use Alexa;" or "use Develpr\AlexaApp\Facades\Alexa;" did the trick :). Thanks a lot - now it works.