-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.php
59 lines (45 loc) · 1.28 KB
/
boot.php
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/*
* Application Dir location
*/
define('BASEPATH', dirname(__FILE__).'/');
ini_set('display_errors', 1);
/*
* PHP Detect line endings for MAC files
*/
if (! ini_get("auto_detect_line_endings")) {
ini_set("auto_detect_line_endings", '1');
}
require_once __DIR__.'/vendor/autoload.php';
/*
* dd helper bootstrapping
*/
require __DIR__.'/vendor/larapack/dd/src/helper.php';
/*
* Environment config management bootstrapping
*/
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
/*
* Database connection bootstrapping
*/
use Illuminate\Database\Capsule\Manager as Database;
$database = new Database;
$database->addConnection([
'driver' => getenv('DB_CONNECTION', 'mysql'),
'host' => getenv('DB_HOST', 'localhost'),
'database' => getenv('DB_DATABASE', 'database'),
'username' => getenv('DB_USERNAME', 'root'),
'password' => getenv('DB_PASSWORD', 'default'),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'timezone' => '+00:00',
'strict' => false,
]);
// Set the event dispatcher used by Eloquent models... (optional)
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
$database->setEventDispatcher(new Dispatcher(new Container));
$database->bootEloquent();
$database->setAsGlobal();