PHP code example of duxet / laravel-rethinkdb

1. Go to this page and download the library: Download duxet/laravel-rethinkdb 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/ */

    

duxet / laravel-rethinkdb example snippets


duxet\Rethinkdb\RethinkdbServiceProvider::class,

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



use duxet\Rethinkdb\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');
    }
}



namespace App;

use duxet\Rethinkdb\Eloquent\Model;

class News extends Model
{
    //
}

use Illuminate\Auth\Authenticatable;
use duxet\Rethinkdb\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends Model implements
    AuthenticatableContract,
    AuthorizableContract,
    CanResetPasswordContract
{
    use Authenticatable, Authorizable, CanResetPassword;
    
    //
}