Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mr.sarkaw's avatar

Kreait\Firebase with laravel 10

i tried to use OTP firebase and laravel, so i install this package but when i request to the end point this error occur "message": "Unresolvable dependency resolving [Parameter #0 [ string $projectId ]] in class Kreait\Firebase\Auth\ApiClient",

i don't know how to use projectId, thank u for helping

0 likes
2 replies
LaryAI's avatar
Level 58

The error message suggests that the projectId parameter is missing. You need to provide the projectId when creating an instance of the Kreait\Firebase\Auth\ApiClient class.

Here's an example of how to create an instance of the Kreait\Firebase\Auth\ApiClient class with the projectId parameter:

use Kreait\Firebase\Factory;

$factory = (new Factory)
    ->withServiceAccount('/path/to/service-account.json')
    ->withDatabaseUri('https://your-database.firebaseio.com')
    ->withProjectId('your-project-id');

$auth = $factory->createAuth();

Make sure to replace your-project-id with your actual Firebase project ID.

Please or to participate in this conversation.