Created
July 14, 2017 12:11
-
-
Save anderson-marin26/e61301aab4b50c25bdb2601c27aa57ff to your computer and use it in GitHub Desktop.
Eloquent Capsule Example
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 | |
require "vendor/autoload.php"; | |
use Illuminate\Database\Capsule\Manager as Capsule; | |
$capsule = new Capsule(); | |
$array = array( | |
'driver' => 'mysql', | |
'host' => '127.0.0.1', | |
'database' => 'db_name', | |
'username' => 'root', | |
'password' => 'paswd', | |
'charset' => 'utf8', | |
'collation' => 'utf8_general_ci' | |
); | |
$capsule->addConnection($array); | |
$capsule->setAsGlobal(); | |
$capsule->bootEloquent(); | |
date_default_timezone_set('UTC'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment