Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Firebase Php

Firebase Php Laravel Package

ktamas77/firebase-php

PHP library for Firebase integration: access Realtime Database, Authentication and other Firebase services with a simple, lightweight API. Supports service account credentials, token handling, and common CRUD operations—useful for Laravel or any PHP app needing Firebase.

Deep Wiki
Context7

ktamas77/firebase-php is a lightweight PHP client for Firebase Realtime Database, designed to make reading and writing data over Firebase’s REST API straightforward. It’s framework-agnostic, easy to drop into any project, and focuses on simple, predictable interactions with your database.

Use it to perform common database operations with minimal setup, while keeping your code clean and testable.

  • CRUD support: get, set, update, push, delete operations
  • REST-based access to Firebase Realtime Database endpoints
  • Authentication support (e.g., database secret / token)
  • Configurable endpoints for different Firebase projects/environments
  • Small footprint with a simple API surface
Frequently asked questions about Firebase Php
How do I install ktamas77/firebase-php in a Laravel project?
Use Composer to install the package with `composer require ktamas77/firebase-php`. No additional Laravel-specific setup is required, though you may want to configure it via a service provider or facade for cleaner usage. The package is framework-agnostic but integrates smoothly with Laravel’s dependency injection.
Does this package support Firebase Authentication alongside Laravel’s built-in auth?
Yes, the package supports Firebase Auth tokens and database secrets. You can use it independently or alongside Laravel’s auth system, though you’ll need to manage token handling (e.g., storing tokens in sessions or stateless APIs). For hybrid setups, consider Laravel Sanctum or Passport for seamless integration.
Can I use this package with Laravel’s Eloquent for hybrid database setups?
Absolutely. The package is designed for Firebase Realtime Database, but you can use it alongside Eloquent by treating Firebase as a secondary data layer. For example, store real-time data in Firebase while keeping relational data in MySQL/PostgreSQL. Implement a dual-write pattern for critical data consistency.
What Laravel versions does ktamas77/firebase-php support?
The package is compatible with PHP 8.x+, which aligns with Laravel 8, 9, and 10. It doesn’t enforce Laravel-specific dependencies, so it works in any PHP project using the same version. Always check the package’s Composer requirements for the latest compatibility details.
How do I configure Firebase endpoints for different environments (e.g., local, staging, production)?
Use Laravel’s configuration system to define Firebase endpoints, credentials, and emulators in `config/services.php` or a custom `config/firebase.php`. This allows you to switch between environments without hardcoding values. The package supports configurable endpoints out of the box.
Is this package suitable for real-time applications like chat apps or live dashboards?
Yes, the package is optimized for Firebase Realtime Database, which is ideal for real-time updates. It supports listeners and push operations, making it perfect for chat apps, live dashboards, or collaborative tools. Combine it with Laravel’s event system for additional real-time features.
How do I handle Firebase service account credentials securely in Laravel?
Store sensitive Firebase credentials (e.g., service account JSON) in Laravel’s `.env` file and access them via `env('FIREBASE_CREDENTIALS')`. Never hardcode credentials in your application. Use Laravel’s encryption for additional security if needed, and restrict file permissions for the credentials file.
Are there alternatives to ktamas77/firebase-php for Laravel Firebase integration?
Yes, alternatives include the official Firebase PHP Admin SDK or packages like `kreait/firebase`. However, `ktamas77/firebase-php` stands out for its lightweight design, simplicity, and focus on Firebase Realtime Database. Choose based on your needs: this package is ideal for REST-based CRUD, while the Admin SDK offers broader Firebase service support.
Can I use this package in Laravel queues or jobs for background Firebase operations?
Yes, you can offload Firebase operations to Laravel queues or jobs (e.g., `FirebaseExportJob`). This is useful for batch writes, exports, or long-running operations. Ensure your queue worker has access to Firebase credentials and handles retries for transient failures.
How do I test Firebase operations in Laravel’s testing environment?
Mock Firebase responses using Laravel’s testing helpers or PHPUnit’s mocking capabilities. For example, use `Mockery` to simulate Firebase API calls in unit tests. Test edge cases like failed writes, authentication errors, and offline scenarios. The package’s simple API makes it easy to isolate and test individual operations.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware