Git Product home page Git Product logo

Comments (13)

jeromegamez avatar jeromegamez commented on July 22, 2024 3

From what I can see, this does indeed look alright dependency-wise 🤔

If Laravel can‘t resolve the firebase.messaging Service (it tries to interpret it as a class name, not as the service name), perhaps the ServiceProvider of the package has not been auto-discovered...

If you do a composer dump-autoload, you should see a Discovered package: kreait/laravel-firebase line. If you don‘t, are you on... wait a minute! According to your composer show output, you haven‘t installed the package 😅

(I‘m writing this all on the phone, that‘s why you are receiving my thoughts and findings unfiltered 🙈)

from laravel-firebase.

jeromegamez avatar jeromegamez commented on July 22, 2024 1

I'm glad we figured it out together 🌺🥳

from laravel-firebase.

jeromegamez avatar jeromegamez commented on July 22, 2024 1

@juanzeta33 Did you add

$app->register(Kreait\Laravel\Firebase\ServiceProvider::class);

to your bootstrap/app.php file?

from laravel-firebase.

juanzeta33 avatar juanzeta33 commented on July 22, 2024 1

Hi,

Forget everything, I just forget to updated the app.php file in my dev server.

Sorry.

from laravel-firebase.

jeromegamez avatar jeromegamez commented on July 22, 2024

You don’t need to instantiate the factory or anything, app('firebase.messaging') is enough to retrieve the fully configured messaging component.

You showed code, but what‘s the problem? 😅

from laravel-firebase.

enefeka avatar enefeka commented on July 22, 2024

Hey, thanks for the quick answer! Problem is I get this error:

Target class [firebase.messaging] does not exist.

from laravel-firebase.

jeromegamez avatar jeromegamez commented on July 22, 2024

Ah, missed the title 😅

Hm, strange. Have you set the FIREBASE_CREDENTIALS variable in your .env file? And could you please share the output of composer show | grep kreait?

from laravel-firebase.

jeromegamez avatar jeromegamez commented on July 22, 2024

If you prefer to use an array instead of a credentials file, you could publish the package configuration and use the array as a value for the credentials.file key (the line where it reads the environment variable by default)

from laravel-firebase.

enefeka avatar enefeka commented on July 22, 2024

Yep I do have the credentials set. This is the output of compose show | grep kreait

kreait/clock 1.0.1 A PHP 7.0 compatible cloc...
kreait/firebase-php 5.2.0 Firebase Admin SDK
kreait/firebase-tokens 1.10.0 A library to work with Fi...

from laravel-firebase.

enefeka avatar enefeka commented on July 22, 2024

Thanks man, I am as stupid as it gets. I could swear I installed it, like I can see myself having done it. Must've done it for another project, or confinement has finally destroyed my brain.

Anyways, thanks again for your help, is working now!

from laravel-firebase.

juanzeta33 avatar juanzeta33 commented on July 22, 2024

Hi, I was having this same error, I read all your comment but I thing I have all the setup config good.

But I have continue getting the error: Class firebase.messaging does not exist

I'm using lumen with the package Kreit.

from laravel-firebase.

juanzeta33 avatar juanzeta33 commented on July 22, 2024

Hi, thanks for the quick answer.

Yep, I have done that.

I follow all the step (I think so) describe in the official documentation.

  1. Add the json file and the FIREBASE_CREDENTIALS in the env
  2. Add the 4 package that install from Kreait (clock, firebase-php, firebase-tokens and laravel-firebase)
  3. Call the Facades in the page that I'm trying to use the messaging.
  4. Call the $messaging = app('firebase.messaging'); for send the push notifications
  5. add the $app->register(Kreait\Laravel\Firebase\ServiceProvider::class); in the app.php

But continue having the error :(

from laravel-firebase.

kdbagwe avatar kdbagwe commented on July 22, 2024

What worked for me is updating packages.php & services.php in bootstrap/cache folder

from laravel-firebase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.