Download the PHP package brunojk/laravel-rethinkdb without Composer

On this page you can find all versions of the php package brunojk/laravel-rethinkdb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-rethinkdb

laravel-rethinkdb

Total Downloads MIT License Build Status Coverage Status Scrutinizer Quality Score

RethinkDB adapter for Laravel (with Eloquent support)

This is a copy of laravel-rethinkdb with a little modifications and new features like belongsToMany relationships and user/password connections!

God bless @jenssegers for his great 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 ;)

This project is aiming at Laravel 5 which is soon to be released, so it might not work with L4.

Installation

Requirements.

  1. Rethinkdb : You need to make sure that you have installed rethinkdb successfully, you can reffer to rethinkdb documentation for the full instruction of how to install rethinkdb.

  2. Laravel 5.2 : this package was designed to work with laravel 5.2, so it will not work with laravel 4.x. (Also works with some bugs on Laravel 5.4)

    Installation

To fully install this package you will have either to add it manually to your composer.json file, or you can execute the following command :

composer require "brunojk/laravel-rethinkdb:dev-master"

This will install the package and all the required package for it to work.

Service Provider

After you install the library you will need to add the Service Provider file to your app.php file like :

brunojk\LaravelRethinkdb\RethinkdbServiceProvider::class,

inside your providers array.

Database configuration

Now 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 :

    'rethinkdb' => [
        'name'      => 'rethinkdb',
        'driver'    => 'rethinkdb',
        'host'      => env('DB_HOST', 'localhost'),
        'port'      => env('DB_PORT', 28015),
        'database'  => env('DB_DATABASE', 'homestead'),            
        'username'  => env('DB_USERNAME', 'admin'),            
        'password'  => env('DB_PASSSWORD', ''),            
    ]

After you add it, you can just configure your enviroment file to be something like :

DB_HOST=localhost
DB_DATABASE=homestead
DB_CONNECTION=rethinkdb
DB_USERNAME=admin
DB_PASSWORD=

but you can always updatr your DB_HOST to point to the IP where you have installed rethinkdb.

Migration

Create a Migration File

You 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:

php artisan make:rethink-migration Users --create (Doesn't on Laravel 5.4)

Please 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

Be 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.

Running The Migrations

Nothing will change here, you will keep using the same laravel commands which you are used to execute to run the migration.

Example of Laravel Users Migration file

This is an example of how the laravel Users Migration file has become

<?php

use brunojk\LaravelRethinkdb\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password', 60);
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}

Model

Create a Model Class

You 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:

php artisan make:rethink-model News

Please 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

Example of Laravel News Model Class

This is an example of how the laravel model class has become

<?php

namespace App;

use \brunojk\LaravelRethinkdb\Eloquent\Model;

class News extends Model
{
    //
}

Update a Model Class

Be 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 \brunojk\LaravelRethinkdb\Eloquent\Model;. The import Illuminate\Foundation\Auth\User needs to be removed from the User model and replaced with \brunojk\LaravelRethinkdb\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.

Example of Laravel User Model Class

This is an example of how the laravel User model class has become


All versions of laravel-rethinkdb with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/container Version >=5.0.0
illuminate/contracts Version >=5.0.0
illuminate/database Version >=5.0.0
illuminate/support Version >=5.0.0
danielmewes/php-rql Version ~2.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package brunojk/laravel-rethinkdb contains the following files

Loading the files please wait ....