Open mattrabe opened 7 years ago
Just to check, did you register the facades as outlined here? https://github.com/develpr/alexa-app#2-adding-the-facadesaliases-for-alexa-and-alexaroute-optional - long story short without registering those you wouldn't be able to do things like Alexa::say(...
, etc.
I'm guessing you perhaps have, and that the issue is "deeper", but I wanted to double check!
Yes, I did enable the facades in bootstrap/app.php like this:
$app->withFacades(); class_alias(\Develpr\AlexaApp\Facades\AlexaRouter::class, 'AlexaRoute'); class_alias(\Develpr\AlexaApp\Facades\Alexa::class, 'Alexa');
For what it's worth I've forked this repo and made changes on a new branch lumen-5.1.7
so that I am able to use static functions at least in some cases in Lumen 5.1.7: https://github.com/mattrabe/alexa-app/tree/lumen-5.1.7
In implementing this I have run into numerous issues, but the central issue I'm seeing seems to relate to the fact that all of the functions in src/Alexa.php are public, non-static functions, yet your readme indicates that they should be called statically. You list
Alexa::say("Hello")
andAlexa::slot('choice')
in your readme, but both functions are non-static. Simply changing say() to a public static function resolves the issue for that function, but the slot() function references $this within itself, and therefore cannot be changed to a static function. Are there unpushed commits or something else I am missing here?