PHP code example of appsero / laravel-datastore

1. Go to this page and download the library: Download appsero/laravel-datastore library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

appsero / laravel-datastore example snippets


Appsero\LaravelDatastore\DatastoreServiceProvider::class,

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



namespace App\Models;

use Appsero\LaravelDatastore\Eloquent\Model;

class Project extends Model
{
    // Your works here
}


DB::connection('datastore')
    ->table('projects')
    ->where('project_id', '>', 5)
    ->skip(3)
    ->take(5)
    ->get();