1 | <?php
|
---|
2 |
|
---|
3 | use Illuminate\Support\Str;
|
---|
4 |
|
---|
5 | return [
|
---|
6 |
|
---|
7 | /*
|
---|
8 | |--------------------------------------------------------------------------
|
---|
9 | | Default Database Connection Name
|
---|
10 | |--------------------------------------------------------------------------
|
---|
11 | |
|
---|
12 | | Here you may specify which of the database connections below you wish
|
---|
13 | | to use as your default connection for all database work. Of course
|
---|
14 | | you may use many connections at once using the Database library.
|
---|
15 | |
|
---|
16 | */
|
---|
17 |
|
---|
18 | 'default' => env('DB_CONNECTION', 'mysql'),
|
---|
19 |
|
---|
20 | /*
|
---|
21 | |--------------------------------------------------------------------------
|
---|
22 | | Database Connections
|
---|
23 | |--------------------------------------------------------------------------
|
---|
24 | |
|
---|
25 | | Here are each of the database connections setup for your application.
|
---|
26 | | Of course, examples of configuring each database platform that is
|
---|
27 | | supported by Laravel is shown below to make development simple.
|
---|
28 | |
|
---|
29 | |
|
---|
30 | | All database work in Laravel is done through the PHP PDO facilities
|
---|
31 | | so make sure you have the driver for your particular database of
|
---|
32 | | choice installed on your machine before you begin development.
|
---|
33 | |
|
---|
34 | */
|
---|
35 |
|
---|
36 | 'connections' => [
|
---|
37 |
|
---|
38 | 'sqlite' => [
|
---|
39 | 'driver' => 'sqlite',
|
---|
40 | 'url' => env('DATABASE_URL'),
|
---|
41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
---|
42 | 'prefix' => '',
|
---|
43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
---|
44 | ],
|
---|
45 |
|
---|
46 | 'mysql' => [
|
---|
47 | 'driver' => 'mysql',
|
---|
48 | 'url' => env('DATABASE_URL'),
|
---|
49 | 'host' => env('DB_HOST', '127.0.0.1'),
|
---|
50 | 'port' => env('DB_PORT', '3306'),
|
---|
51 | 'database' => env('DB_DATABASE', 'forge'),
|
---|
52 | 'username' => env('DB_USERNAME', 'forge'),
|
---|
53 | 'password' => env('DB_PASSWORD', ''),
|
---|
54 | 'unix_socket' => env('DB_SOCKET', ''),
|
---|
55 | //'charset' => 'utf8mb4',
|
---|
56 | //'collation' => 'utf8mb4_unicode_ci',
|
---|
57 | 'charset' => 'utf8',
|
---|
58 | 'collation' => 'utf8_unicode_ci',
|
---|
59 | 'prefix' => '',
|
---|
60 | 'prefix_indexes' => true,
|
---|
61 | 'strict' => true,
|
---|
62 | 'engine' => null,
|
---|
63 | 'options' => extension_loaded('pdo_mysql') ? array_filter([
|
---|
64 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
---|
65 | ]) : [],
|
---|
66 | ],
|
---|
67 |
|
---|
68 | 'pgsql' => [
|
---|
69 | 'driver' => 'pgsql',
|
---|
70 | 'url' => env('DATABASE_URL'),
|
---|
71 | 'host' => env('DB_HOST', '127.0.0.1'),
|
---|
72 | 'port' => env('DB_PORT', '5432'),
|
---|
73 | 'database' => env('DB_DATABASE', 'forge'),
|
---|
74 | 'username' => env('DB_USERNAME', 'forge'),
|
---|
75 | 'password' => env('DB_PASSWORD', ''),
|
---|
76 | 'charset' => 'utf8',
|
---|
77 | 'prefix' => '',
|
---|
78 | 'prefix_indexes' => true,
|
---|
79 | 'schema' => 'public',
|
---|
80 | 'sslmode' => 'prefer',
|
---|
81 | ],
|
---|
82 |
|
---|
83 | 'sqlsrv' => [
|
---|
84 | 'driver' => 'sqlsrv',
|
---|
85 | 'url' => env('DATABASE_URL'),
|
---|
86 | 'host' => env('DB_HOST', 'localhost'),
|
---|
87 | 'port' => env('DB_PORT', '1433'),
|
---|
88 | 'database' => env('DB_DATABASE', 'forge'),
|
---|
89 | 'username' => env('DB_USERNAME', 'forge'),
|
---|
90 | 'password' => env('DB_PASSWORD', ''),
|
---|
91 | 'charset' => 'utf8',
|
---|
92 | 'prefix' => '',
|
---|
93 | 'prefix_indexes' => true,
|
---|
94 | ],
|
---|
95 |
|
---|
96 | ],
|
---|
97 |
|
---|
98 | /*
|
---|
99 | |--------------------------------------------------------------------------
|
---|
100 | | Migration Repository Table
|
---|
101 | |--------------------------------------------------------------------------
|
---|
102 | |
|
---|
103 | | This table keeps track of all the migrations that have already run for
|
---|
104 | | your application. Using this information, we can determine which of
|
---|
105 | | the migrations on disk haven't actually been run in the database.
|
---|
106 | |
|
---|
107 | */
|
---|
108 |
|
---|
109 | 'migrations' => 'migrations',
|
---|
110 |
|
---|
111 | /*
|
---|
112 | |--------------------------------------------------------------------------
|
---|
113 | | Redis Databases
|
---|
114 | |--------------------------------------------------------------------------
|
---|
115 | |
|
---|
116 | | Redis is an open source, fast, and advanced key-value store that also
|
---|
117 | | provides a richer body of commands than a typical key-value system
|
---|
118 | | such as APC or Memcached. Laravel makes it easy to dig right in.
|
---|
119 | |
|
---|
120 | */
|
---|
121 |
|
---|
122 | 'redis' => [
|
---|
123 |
|
---|
124 | 'client' => env('REDIS_CLIENT', 'phpredis'),
|
---|
125 |
|
---|
126 | 'options' => [
|
---|
127 | 'cluster' => env('REDIS_CLUSTER', 'redis'),
|
---|
128 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
---|
129 | ],
|
---|
130 |
|
---|
131 | 'default' => [
|
---|
132 | 'url' => env('REDIS_URL'),
|
---|
133 | 'host' => env('REDIS_HOST', '127.0.0.1'),
|
---|
134 | 'password' => env('REDIS_PASSWORD', null),
|
---|
135 | 'port' => env('REDIS_PORT', '6379'),
|
---|
136 | 'database' => env('REDIS_DB', '0'),
|
---|
137 | ],
|
---|
138 |
|
---|
139 | 'cache' => [
|
---|
140 | 'url' => env('REDIS_URL'),
|
---|
141 | 'host' => env('REDIS_HOST', '127.0.0.1'),
|
---|
142 | 'password' => env('REDIS_PASSWORD', null),
|
---|
143 | 'port' => env('REDIS_PORT', '6379'),
|
---|
144 | 'database' => env('REDIS_CACHE_DB', '1'),
|
---|
145 | ],
|
---|
146 |
|
---|
147 | ],
|
---|
148 |
|
---|
149 | ];
|
---|