Skip to content

Instantly share code, notes, and snippets.

@rodrigore
Last active June 28, 2016 20:04
Show Gist options
  • Save rodrigore/c34ea696414d466d736ff6aa7f749d7a to your computer and use it in GitHub Desktop.
Save rodrigore/c34ea696414d466d736ff6aa7f749d7a to your computer and use it in GitHub Desktop.
  • composer require 'illuminate/database:5.2.*'

  • Configurar eloquent

use Illuminate\Database\Capsule\Manager as Capsule;

$capsule = new Capsule;
$capsule->addConnection([
  'driver' => 'mysql',
  'host' => DB_HOST,
  'port' => DB_PORT,
  'database' => DB_NAME,
  'username' => DB_USER,
  'password' => DB_PASSWORD,
  'charset' => 'utf8',
  'collation' => 'utf8_unicode_ci',
]);

$capsule->setAsGlobal();

$capsule->bootEloquent();
  • Crear un archivo model que herede de Model
use Illuminate\Database\Eloquent\Model;

class Score extends Model
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment