예제 #1
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
use Illuminate\Container\Container;
$capsule = new Capsule();
$capsule->addConnection(['driver' => 'mysql', 'host' => 'localhost', 'database' => 'task', 'username' => 'root', 'password' => 'Lennar@123', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '']);
// Set the event dispatcher used by Eloquent models... (optional)
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
$capsule->setEventDispatcher(new Dispatcher(new Container()));
// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();
// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();