Created
October 28, 2014 17:35
-
-
Save diegocasmo/ff72587dda7ca0a03ead to your computer and use it in GitHub Desktop.
Laravel Eloquent setup snippet for use outside of the framework.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Setup Eloquent. */ | |
use Illuminate\Database\Capsule\Manager as Capsule; | |
use Illuminate\Events\Dispatcher; | |
use Illuminate\Container\Container; | |
$capsule = new Capsule; | |
$capsule->addConnection([ | |
"driver" => "mysql", | |
"host" => "127.0.0.1", | |
"database" => "", | |
"username" => "", | |
"password" => "", | |
"charset" => "utf8", | |
"collation" => "utf8_general_ci", | |
"prefix" => "" | |
]); | |
$capsule->setEventDispatcher(new Dispatcher(new Container)); | |
$capsule->bootEloquent(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment