Weave 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
Eloquent Datastore

Eloquent Datastore Laravel Package

affordablemobiles/eloquent-datastore

Eloquent Datastore brings a familiar Eloquent-style model layer to Google Cloud Datastore, letting Laravel developers query, persist and relate data using the syntax they already know. A practical bridge for apps running on Datastore without giving up Eloquent conventions.

View on GitHub
Deep Wiki
Context7

Google Datastore with Laravel's Eloquent ORM

Frequently asked questions about Eloquent Datastore
What is affordablemobiles/eloquent-datastore and what problem does it solve?
It is a Laravel package that adds an Eloquent-inspired model layer on top of Google Cloud Datastore. Instead of working with the raw Datastore API and entity arrays, you define models and use fluent queries similar to what you already know from Eloquent. It is aimed at teams running Laravel apps on Datastore who do not want to abandon Laravel conventions.
How do I install eloquent-datastore in a Laravel application?
Install the package with Composer using composer require affordablemobiles/eloquent-datastore. Laravel's package auto-discovery should register the service provider, but you can add it manually in your providers configuration if needed. Then publish the package configuration so you can set your Google Cloud project and Datastore connection details.
Which Laravel versions does eloquent-datastore support?
The package is built for Laravel and registers its own service provider, so it follows the framework's normal package conventions. Exact Illuminate version constraints depend on the tagged release, so check the composer.json requirements on Packagist or the GitHub repository before installing. Pin a version that matches the Laravel release your application runs on.
How do I configure the Datastore connection for Laravel?
After publishing the configuration file, provide your Google Cloud project ID and any Datastore-specific options such as namespace or emulator host. Credentials typically come from a service account JSON file referenced by an environment variable, or from the default application credentials available to your runtime. Keep these values in your .env file so local and production environments can differ.
Does it support fluent queries and where clauses like Eloquent?
Yes, the package exposes a fluent query builder over Datastore entities, so you can chain filters and retrieve results in an Eloquent-like style. Because Datastore is a NoSQL datastore, you should expect Datastore semantics rather than full SQL behaviour, so joins and some relational patterns are not available. Design your entity keys and indexes with those constraints in mind.
How are Datastore keys and entity hydration handled?
Models map to Datastore entities, and the package handles key generation and hydration of entity data back into model attributes. This lets you work with model instances and attributes rather than raw entity objects. You should still understand Datastore key structure, since ancestor paths and key names affect lookups and consistency.
Does eloquent-datastore support accessors, mutators, and attribute casting?
Yes, it supports attribute casting plus accessor and mutator methods on your models, mirroring the Eloquent developer experience. That means you can transform values on read and write, and cast stored values into types your application expects. It keeps model classes readable instead of scattering formatting logic through your application code.
Can I define relationships between Datastore models?
You can model relationships using key references between entities and resolve them through your model classes. Datastore has no joins, so related data is fetched with additional lookups rather than a single query. Plan your denormalisation and key design carefully to keep request counts and latency under control.
How should I test an application that uses Datastore models?
The most reliable approach is to run the Google Cloud Datastore emulator in your test environment and point the package configuration at the emulator host. That lets you exercise real queries, keys and hydration without touching production data. Isolating model logic behind services also makes unit testing easier where a live datastore is impractical.
Is eloquent-datastore suitable for production, and what are the alternatives?
It is a practical bridge for Laravel applications already committed to Google Cloud Datastore, and it keeps your data layer consistent with Eloquent conventions. The main alternative is the official Google Cloud Datastore PHP client used directly, which offers full API coverage but no model layer. Whichever you choose, review the package's recent commits and issue activity to confirm it is actively maintained against your Laravel version.
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource