{"id":19601999,"url":"https://github.com/egs33/laravel-datastore-auth","last_synced_at":"2025-09-15T20:32:52.641Z","repository":{"id":56975816,"uuid":"153597437","full_name":"egs33/laravel-datastore-auth","owner":"egs33","description":"Laravel authentication using Google Datastore","archived":false,"fork":false,"pushed_at":"2020-09-16T13:07:10.000Z","size":84,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-10T23:30:26.833Z","etag":null,"topics":["cloud-datastore","laravel","laravel-5-package","laravel-6-package","laravel-authentication"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/egs33.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-18T09:21:22.000Z","updated_at":"2023-04-28T08:59:18.000Z","dependencies_parsed_at":"2022-08-21T11:20:42.372Z","dependency_job_id":null,"html_url":"https://github.com/egs33/laravel-datastore-auth","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egs33%2Flaravel-datastore-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egs33%2Flaravel-datastore-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egs33%2Flaravel-datastore-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egs33%2Flaravel-datastore-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egs33","download_url":"https://codeload.github.com/egs33/laravel-datastore-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233156311,"owners_count":18633476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-datastore","laravel","laravel-5-package","laravel-6-package","laravel-authentication"],"created_at":"2024-11-11T09:21:43.419Z","updated_at":"2025-09-15T20:32:52.291Z","avatar_url":"https://github.com/egs33.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Datastore Auth\n[Laravel authentication](https://laravel.com/docs/master/authentication) using [Google Datastore](https://cloud.google.com/datastore/docs/)\n\n[![CircleCI](https://circleci.com/gh/egs33/laravel-datastore-auth.svg?style=shield)](https://circleci.com/gh/egs33/laravel-datastore-auth)\n[![Latest Stable Version](https://poser.pugx.org/egs33/laravel-datastore-auth/v/stable)](https://packagist.org/packages/egs33/laravel-datastore-auth)\n[![License](https://poser.pugx.org/egs33/laravel-datastore-auth/license)](https://packagist.org/packages/egs33/laravel-datastore-auth)\n[![codecov](https://codecov.io/gh/egs33/laravel-datastore-auth/branch/master/graph/badge.svg)](https://codecov.io/gh/egs33/laravel-datastore-auth)\n\n## Requirements\n\n- Laravel \u003e= 5.5.0\n- Composer\n\n## Installation\n\n    $ composer require egs33/laravel-datastore-auth\n    $ php artisan vendor:publish --provider=\"DatastoreAuth\\DatastoreAuthServiceProvider\"\n\n## Quick Start\n\nSet authentication driver to `datastore`. \nFor example, in `config/auth.php`\n```php\n    'providers' =\u003e [\n        'users' =\u003e [\n            'driver' =\u003e 'datastore'\n        ]\n    ],\n```\n\nThen it can use same as [Laravel authentication](https://laravel.com/docs/5.7/authentication)\n\n## Usage\n\n### Create user\n```php\n$userConfig = [\n    'name' =\u003e 'hoge',\n    'email' =\u003e 'hoge@example.com',\n    'password' =\u003e 'secret'\n];\n$userProvider = Auth::createUserProvider('users');\n$userProvider-\u003ecreate($userConfig);\n// or\nDatastoreAuth::create($userConfig);\n```\n\n### Get Current User etc.\nUse `Auth` facade.\nSame as [Laravel authentication](https://laravel.com/docs/5.7/authentication)\n```php\n$user = Auth::user(); // get current user\n$isLoggedIn = Auth::check();\n```\n\n### Update User Data\n```php\n$user['name'] = 'new-name';\n$user['group'] = 'new-group';\n$user-\u003esave();\n```\n\n## Config\n\nConfig file is `config/datastore_auth.php`\n\nDefault is\n```php\n[\n    'client_config' =\u003e [],\n    'kind' =\u003e 'users',\n    'cache' =\u003e [\n        'isEnabled' =\u003e false,\n        'keyPrefix' =\u003e \\DatastoreAuth\\DatastoreUserProvider::class . ':',\n        'ttl' =\u003e null,\n    ]\n]\n```\n\n`client_config` is passed to constructor of `Google\\Cloud\\Datastore\\DatastoreClient`.\nPlease see [document](https://googleapis.github.io/google-cloud-php/#/docs/cloud-datastore/v1.7.0/datastore/datastoreclient) of `google/cloud-datastore`.\n\n`kind` is kind name of user table.\n\n### Cache\n\nThe cache is only used when fetch user by id.\nCache storage is specified by `config/cache.php` in your laravel project.\n`ttl` is expressed in seconds regardless of the laravel version.\nIf it's null, no expire.\n\nWhen `DatastoreUserProvider#resetPassword`, `DatastoreUserProvider#save`, `DatastoreUserProvider#updateRememberToken`\nor `User#save` is called, cache is cleared.\nBut you can call `DatastoreUserProvider#deleteCache` if necessary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegs33%2Flaravel-datastore-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegs33%2Flaravel-datastore-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegs33%2Flaravel-datastore-auth/lists"}