PHPackages                             appsero/laravel-datastore - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. appsero/laravel-datastore

ActivePackage[Database &amp; ORM](/categories/database)

appsero/laravel-datastore
=========================

A package for using google datastore as a database driver.

0.0.6(2y ago)56005[2 PRs](https://github.com/Appsero/laravel-datastore/pulls)MITPHPPHP ^7.2|^8.0

Since Nov 26Pushed 1y agoCompare

[ Source](https://github.com/Appsero/laravel-datastore)[ Packagist](https://packagist.org/packages/appsero/laravel-datastore)[ Docs](https://github.com/appsero/laravel-datastore)[ RSS](/packages/appsero-laravel-datastore/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (8)Used By (0)

[![Laravel Datastore](https://camo.githubusercontent.com/b21ebadf733344cbe77c8a13c6393f1caebdf6294ed18b0481a57c9297ed8dcc/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532304461746173746f72652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d4170707365726f2532466c61726176656c2d6461746173746f7265267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d5061636b6167652b666f722b7573696e672b676f6f676c652b6461746173746f72652b61732b612b64617461626173652b6472697665722b696e2b6c61726176656c2e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d6461746162617365)](https://camo.githubusercontent.com/b21ebadf733344cbe77c8a13c6393f1caebdf6294ed18b0481a57c9297ed8dcc/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532304461746173746f72652e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d4170707365726f2532466c61726176656c2d6461746173746f7265267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d5061636b6167652b666f722b7573696e672b676f6f676c652b6461746173746f72652b61732b612b64617461626173652b6472697665722b696e2b6c61726176656c2e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d6461746162617365)

Datastore Driver for Laravel
============================

[](#datastore-driver-for-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/705c6829d87afea067f8681eca23c8573ff2f5c2693c1860e242991651e0f52e/68747470733a2f2f706f7365722e707567782e6f72672f6170707365726f2f6c61726176656c2d6461746173746f72652f76)](https://camo.githubusercontent.com/705c6829d87afea067f8681eca23c8573ff2f5c2693c1860e242991651e0f52e/68747470733a2f2f706f7365722e707567782e6f72672f6170707365726f2f6c61726176656c2d6461746173746f72652f76)[![License](https://camo.githubusercontent.com/e4254fb54c8c7e02a3b2c04546f129315594db397ad4dd66679c897e27a0c445/68747470733a2f2f706f7365722e707567782e6f72672f6170707365726f2f6c61726176656c2d6461746173746f72652f6c6963656e7365)](https://camo.githubusercontent.com/e4254fb54c8c7e02a3b2c04546f129315594db397ad4dd66679c897e27a0c445/68747470733a2f2f706f7365722e707567782e6f72672f6170707365726f2f6c61726176656c2d6461746173746f72652f6c6963656e7365)

A package for using google datastore as a database driver.

---

By using this package, you can use `query builder` and `eloquent` to access data from datastore.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require appsero/laravel-datastore
```

If you are using Laravel Package Auto-Discovery, you don't need you to manually add the ServiceProvider.

#### Without auto-discovery:

[](#without-auto-discovery)

If you don't use auto-discovery, add the below ServiceProvider to the `$providers` array in `config/app.php` file.

```
Appsero\LaravelDatastore\DatastoreServiceProvider::class,
```

Roadmap
-------

[](#roadmap)

- Data read using query builder (available).
- Data read using eloquent model (available).
- Data insert (available).
- Data update (Using query builder, model coming soon).
- Data delete (available).
- Cursor Paginate (soon).
- Relations (soon).

Usage
-----

[](#usage)

You need to add `datastore` connection in `config/database.php` file.

```
'connections' => [
    ...
    'datastore' => [
        'driver' => 'datastore',
        'key_file_path' => env('GOOGLE_APPLICATION_CREDENTIALS', 'gcloud-credentials.json'),
        'prefix' => env('DATASTORE_PREFIX', null),
    ],
    ...
],
```

### Access using Eloquent Model

[](#access-using-eloquent-model)

You need to extend `Appsero\LaravelDatastore\Eloquent\Model` class instead of laravel's default eloquent model class.

**Example-**

```
