Comments (21)
@chimit @ulver2812 Could you please try the two following alternatives?
'credentials' => [
'file' => base_path().DIRECTORY_SEPARATOR.env('FIREBASE_CREDENTIALS'),
],
or
'credentials' => [
'file' => base_path(env('FIREBASE_CREDENTIALS'))
],
Please also make sure that, if on Windows, you use \\
instead of /
in your .env
file, I think otherwise the paths will not be resolved
from laravel-firebase.
Ah, sorry! My mistake! Just realized that I forgot to apply config in the bootstrap/app.php
(Lumen):
$app->configure('firebase');
So yes, this config works:
'credentials' => [
'file' => base_path(env('FIREBASE_CREDENTIALS')),
from laravel-firebase.
If somebody of you guys is still having this issue in Laravel 5.8. You can use the php function realpath
to do the following in the config/firebase.php
file:
'credentials' => [
// For this example the FIREBASE_CREDENTIALS_FILENAME is in the project 's root folder
'file' => realpath('.' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . env('FIREBASE_CREDENTIALS_FILENAME')),
'auto_discovery' => true,
],
from laravel-firebase.
Possible solution is to use base_path() in the config file:
'credentials' => [
'file' => base_path() . '/' . env('FIREBASE_CREDENTIALS'),
'auto_discovery' => true,
],
from laravel-firebase.
Sorry for the late reply! This is probably something that I should investigate in the main SDK - it seems to be a Windows issue, I just tried it with a relative path like yours, and it works on my machine(™).
from laravel-firebase.
After having begun to implement GitHub Actions, I can now confirm the issue 🎉 (see e.g. https://github.com/kreait/firebase-php/runs/378003314). As soon as I have finished the GitHub Actions setup, I will look for a way to fix the problem. 🤞
Update: I can confirm that there is an issue 😅, it's not the same as you described :)
from laravel-firebase.
Modifying the config file doesn't help. Currently, the only way to make it work is to specify the full path in the .env
file.
from laravel-firebase.
Both don't work. Apparently, this credentials.file
parameter is just ignored.
from laravel-firebase.
It's not - (or) have you step-debugged the package's service provider to be able to see what the issue is/that this is the issue?
from laravel-firebase.
@chimit Yessss 🎉 - can I assume that you are currently using the branch that I gave you in #8? Asking for a friend who would then create a new release 😅
from laravel-firebase.
Yes, apparently, it's working with Lumen 6.3. Just want to finish push notifications to make sure there are no other problems. Will confirm it separately on that issue page.
Thanks a lot! 👍
from laravel-firebase.
Hi @jeromegamez, sorry for the late reply (I didn't receive the github notification).
My current fix is this:
Possible solution is to use base_path() in the config file:
'credentials' => [ 'file' => base_path() . '/' . env('FIREBASE_CREDENTIALS'), 'auto_discovery' => true, ],
On Windows it works, I didn't investigate further...
from laravel-firebase.
@ulver2812 I updated Lumen instructions (#11). Do we need to add base_path()
into the config/firebase.php
now?
from laravel-firebase.
Unfortunately, it's not as easy. base_path()
would break things if a full path is provided (like /full/path/to/service_account.json
or C:\\full\path\to\service_account.json
), it would only work for relative paths.
So, while this might work on your local machine, where you put the service account file in the project directory, it might break on a production machine where the file could be outside the project directory. Also, on one machine you could be on Windows, on the other on Linux... I'll try to come up with something, but I need it to be a stable solution 😅
from laravel-firebase.
So, at the end the best thing to do is to use absolute paths 🤷♂️
from laravel-firebase.
Could you please check out and try #13 to see if this works for you on Windows?
from laravel-firebase.
Sorry but I can't check right now, I will try as soon as possible. Thanks
from laravel-firebase.
Using absolute paths is not very convenient when you deploy your project to many environments or change them. As for me, a relative path should be a default.
from laravel-firebase.
@chimit Could you please test if #13 works for you?
from laravel-firebase.
It's been long enough, I will merge #13 and if something doesn't work, someone will let me know for sure :)
from laravel-firebase.
Merged with 3213acc, released with 1.4.0
from laravel-firebase.
Related Issues (20)
- Laravel error HOT 2
- getting error HOT 1
- Incompatibility with Eloquent Resources? HOT 1
- Confirm email verification Support
- Its not supported php 8. Please fix this
- Push notifications are not getting displayed in IOS and Android randomly HOT 1
- Be able to override FirestoreClient::DEFAULT_DATABASE HOT 7
- Support PHP8.3 HOT 2
- Firestore insert or update problem when using laravel-octane HOT 3
- Auto discovery not working similar to v4.x HOT 6
- Cannot mock final class for phpunit tests as it's return type is other final class HOT 1
- Support symfony/cache version 7 HOT 3
- Make Support For Laravel 11 HOT 2
- Curl error on Laravel 11 HOT 9
- laravel publish issue HOT 1
- Unable to install kreait/laravel-firebase on Laravel 11 project HOT 1
- Binding Error with 5.9 HOT 2
- Log Channel Not Working HOT 1
- Unable to send notification to multiple devices at one. HOT 5
- Dependency issue preventing installation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-firebase.