-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
33 lines (24 loc) · 814 Bytes
/
bootstrap.php
File metadata and controls
33 lines (24 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
require_once __DIR__.'/vendor/autoload.php';
use Illuminate\Database\Capsule\Manager as Capsule;
//(new \Symfony\Component\Dotenv\Dotenv())->load(__DIR__.'/.env');
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'monitor',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
]);
// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();
// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();
set_exception_handler(function($e){
header('content-type:application/json');
echo json_encode(['message' => $e->getMessage()]);
die();
});