{"id":16411915,"url":"https://github.com/duxet/laravel-rethinkdb","last_synced_at":"2025-08-12T17:40:41.143Z","repository":{"id":24113228,"uuid":"27501333","full_name":"duxet/laravel-rethinkdb","owner":"duxet","description":"RethinkDB adapter for Laravel (with Eloquent support)","archived":false,"fork":false,"pushed_at":"2019-07-26T06:49:26.000Z","size":151,"stargazers_count":149,"open_issues_count":14,"forks_count":37,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-08-01T14:46:01.669Z","etag":null,"topics":["laravel","laravel-rethinkdb","php","rethinkdb","rethinkdb-adapter"],"latest_commit_sha":null,"homepage":null,"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/duxet.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":"2014-12-03T18:28:05.000Z","updated_at":"2025-02-10T16:17:35.000Z","dependencies_parsed_at":"2022-08-06T00:15:15.140Z","dependency_job_id":null,"html_url":"https://github.com/duxet/laravel-rethinkdb","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/duxet/laravel-rethinkdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duxet%2Flaravel-rethinkdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duxet%2Flaravel-rethinkdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duxet%2Flaravel-rethinkdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duxet%2Flaravel-rethinkdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duxet","download_url":"https://codeload.github.com/duxet/laravel-rethinkdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duxet%2Flaravel-rethinkdb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270108253,"owners_count":24528758,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["laravel","laravel-rethinkdb","php","rethinkdb","rethinkdb-adapter"],"created_at":"2024-10-11T06:47:01.037Z","updated_at":"2025-08-12T17:40:41.111Z","avatar_url":"https://github.com/duxet.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"laravel-rethinkdb\n=================\n\n\n[![Total Downloads](https://img.shields.io/packagist/dt/duxet/laravel-rethinkdb.svg?style=flat)](https://packagist.org/packages/duxet/laravel-rethinkdb)\n[![MIT License](https://img.shields.io/packagist/l/duxet/laravel-rethinkdb.svg?style=flat)](https://packagist.org/packages/duxet/laravel-rethinkdb)\n[![Build Status](https://img.shields.io/travis/duxet/laravel-rethinkdb/master.svg?style=flat)](https://travis-ci.org/duxet/laravel-rethinkdb)\n[![Coverage Status](https://img.shields.io/codeclimate/coverage/github/duxet/laravel-rethinkdb.svg?style=flat)](https://codeclimate.com/github/duxet/laravel-rethinkdb)\n[![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/duxet/laravel-rethinkdb/master.svg?style=flat)](https://scrutinizer-ci.com/g/duxet/laravel-rethinkdb/)\n\nRethinkDB adapter for Laravel (with Eloquent support)\n\nGod bless [@jenssegers](https://github.com/jenssegers) for his great [laravel-mongodb](https://github.com/jenssegers/laravel-mongodb) project. I have used his tests and some other code, since it's awesome codebase for supporting other NoSQL databases. I hope he won't be angry on me for that ;)\n\n# Installation\n\n## Requirements.\n\n1. RethinkDB: You need to make sure that you have installed [RethinkDB](http://www.rethinkdb.com) successfully, you can reffer to rethinkdb [documentation](https://rethinkdb.com/docs/) for the full instruction of how to install RethinkDB.\n\n1. Laravel 5.2: this package was designed to work with [Laravel](http://laravel.com) 5.2, so it will not work with laravel 4.x.\n\n## Installation\n\nTo fully install this package you will have either to add it manually to your `composer.json` file, or you can execute the following command :\n\n`composer require \"duxet/laravel-rethinkdb:dev-master\"`\n\nThis will install the package and all the required package for it to work.\n\n## Service Provider\n\nAfter you install the library you will need to add the `Service Provider` file to your `app.php` file like :\n\n```php\nduxet\\Rethinkdb\\RethinkdbServiceProvider::class,\n```\n\ninside your `providers` array.\n\n## Database configuration\n\nNow that you have the service provider setup, you will need to add the following configuration array at the end of your database connections array like :\n\n```php\n'rethinkdb' =\u003e [\n    'name'      =\u003e 'rethinkdb',\n    'driver'    =\u003e 'rethinkdb',\n    'host'      =\u003e env('DB_HOST', 'localhost'),\n    'port'      =\u003e env('DB_PORT', 28015),\n    'database'  =\u003e env('DB_DATABASE', 'homestead'),            \n]\n```\n\nAfter you add it, you can just configure your enviroment file to be something like :\n\n```\nDB_HOST=localhost\nDB_DATABASE=homestead\nDB_CONNECTION=rethinkdb\n```\n\nbut you can always updatr your `DB_HOST` to point to the IP where you have installed RethinkDB.\n\n# Migration\n\n## Create a Migration File\n\nYou can easily create a migration file using the following command which will create a migration file for you to create the users table and use the package schema instead of Laravel schema:\n\n`php artisan make:rethink-migration Users --create`\n\nPlease note that you can use the same options that you use in `make:migration` with `make:rethink-migration`, as its based on laravel `make:migration`\n\nBe aware that Laravel Schema API is not fully implemented.  For example, ID columns using increments will not be auto-incremented unsigned integers, and will instead be a UUID unless explicitly set.  The easiest solution is to maintain UUID use within RethinkDB, turn off incremental IDs in Laravel, and finally implement UUID use in Laravel.\n\n\n## Running The Migrations\n\nNothing will change here, you will keep using the same laravel commands which you are used to execute to run the migration.\n\n## Example of Laravel Users Migration file\n\nThis is an example of how the laravel Users Migration file has become\n\n```php\n\u003c?php\n\nuse duxet\\Rethinkdb\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateUsersTable extends Migration\n{\n    /**\n     * Run the migrations.\n     *\n     * @return void\n     */\n    public function up()\n    {\n        Schema::create('users', function (Blueprint $table) {\n            $table-\u003eincrements('id');\n            $table-\u003estring('name');\n            $table-\u003estring('email')-\u003eunique();\n            $table-\u003estring('password', 60);\n            $table-\u003erememberToken();\n            $table-\u003etimestamps();\n        });\n    }\n\n    /**\n     * Reverse the migrations.\n     *\n     * @return void\n     */\n    public function down()\n    {\n        Schema::drop('users');\n    }\n}\n```\n\n# Model\n\n## Create a Model Class\n\nYou can easily create a model class using the following command which will create it for you and use the package model instead of Laravel model:\n\n`php artisan make:rethink-model News`\n\nPlease note that you can use the same options that you use in `make:model` with `make:rethink-model`, as its based on laravel `make:model`\n\n## Example of Laravel News Model Class\n\nThis is an example of how the laravel model class has become\n\n```php\n\u003c?php\n\nnamespace App;\n\nuse duxet\\Rethinkdb\\Eloquent\\Model;\n\nclass News extends Model\n{\n    //\n}\n```\n\n## Update a Model Class\n\nBe aware that any model that Laravel generates during its initial installation will need to be updated manually in order for them to work properly.  For example, the User model extends `Illuminate\\Foundation\\Auth\\User`, which further extends `Illuminate\\Database\\Eloquent\\Model` instead of `\\duxet\\Rethinkdb\\Eloquent\\Model;`. The import `Illuminate\\Foundation\\Auth\\User` needs to be removed from the User model and replaced with `\\duxet\\Rethinkdb\\Eloquent\\Model;`, and any interfaces and associated traits implemented in `Illuminate\\Foundation\\Auth\\User` that are required will need to be ported to the User model.\n\n## Example of Laravel User Model Class\n\nThis is an example of how the laravel User model class has become\n\n```php\nuse Illuminate\\Auth\\Authenticatable;\nuse duxet\\Rethinkdb\\Eloquent\\Model;\nuse Illuminate\\Auth\\Passwords\\CanResetPassword;\nuse Illuminate\\Foundation\\Auth\\Access\\Authorizable;\nuse Illuminate\\Contracts\\Auth\\Authenticatable as AuthenticatableContract;\nuse Illuminate\\Contracts\\Auth\\Access\\Authorizable as AuthorizableContract;\nuse Illuminate\\Contracts\\Auth\\CanResetPassword as CanResetPasswordContract;\n\nclass User extends Model implements\n    AuthenticatableContract,\n    AuthorizableContract,\n    CanResetPasswordContract\n{\n    use Authenticatable, Authorizable, CanResetPassword;\n    \n    //\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduxet%2Flaravel-rethinkdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduxet%2Flaravel-rethinkdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduxet%2Flaravel-rethinkdb/lists"}