1. Go to this page and download the library: Download coding-socks/reloquent 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/ */
coding-socks / reloquent example snippets
use CodingSocks\Reloquent\Model;
class Movie extends Model
{
protected $schema = [
'title' => ['type' => 'string', 'textSearch' => true],
'year' => ['type' => 'number'],
'directors' => ['type' => 'array'],
];
}
namespace App\Models;
use CodingSocks\Reloquent\Model;
class Movie extends Model
{
protected $schema = [
'title' => ['type' => 'string', 'textSearch' => true],
'year' => ['type' => 'number'],
'directors' => ['type' => 'array'],
];
}
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMoviesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('movies', function (Blueprint $table) {
$table->string('title')->textSearch();
$table->integer('year');
$table->array('directors');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('movies');
}
}