Closed pietersonbadoa closed 2 years ago
Please also share the installed versions of kreait/laravel-firebase
and kreait/firebase-php
(with composer show
).
Your code looks fine, but none of the occurrences mentioned in the stack trace contain a |
character, at least not in Release 5.22 of the SDK.
The info that this is a Syntax error
leads me to believe that the environment this code is running in might in fact not be PHP 8 (or even PHP 7.4).
Can you confirm the PHP version when you insert a dd(phpversion());
or dd(PHP_VERSION);
in the controller?
You are right, apparently my apache is running php7.4.16 instead of php8.0 (which is what printed out when I typed php --version on terminal). I tried to switch back and forward between those two php version on my apache, but the error persists.
I'm thinking maybe I messed up something somewhere on my Firebase project configuration, but have no idea how to debug that out.
I'll try to reproduce this problem on a fresh Laravel installation. And let you know the result..
Thanks for speedy reply btw.. :)
Okay I'm closing this issue because apparently this is just a silly mistake from a newbie.. I tested on a fresh laravel installation on my apache server, the problem exist.. But when I tried to run the laravel artisan serve instead, and the code works fine... So the problem is on my apache/php installation instead of the library.
Thanks for sharing your findings!
I got the following Error while trying to fetch user info by firebase uid:
This is my laravel controller method:
PHP verson: 8.0.3 Laravel version: 8.12