Skip to content

Commit 512a855

Browse files
authored
[Bug] Published database config and added DB_SEARCH_PATH as env variable (alexjustesen#2157)
1 parent b6c34e8 commit 512a855

File tree

1 file changed

+166
-1
lines changed

1 file changed

+166
-1
lines changed

config/database.php

Lines changed: 166 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,175 @@
11
<?php
22

3+
use Illuminate\Support\Str;
4+
35
return [
46

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 database operations. This is
14+
| the connection which will be utilized unless another connection
15+
| is explicitly specified when you execute a query / statement.
16+
|
17+
*/
18+
19+
'default' => env('DB_CONNECTION', 'sqlite'),
20+
21+
/*
22+
|--------------------------------------------------------------------------
23+
| Database Connections
24+
|--------------------------------------------------------------------------
25+
|
26+
| Below are all of the database connections defined for your application.
27+
| An example configuration is provided for each database system which
28+
| is supported by Laravel. You're free to add / remove connections.
29+
|
30+
*/
31+
32+
'connections' => [
33+
34+
'sqlite' => [
35+
'driver' => 'sqlite',
36+
'url' => env('DB_URL'),
37+
'database' => env('DB_DATABASE', database_path('database.sqlite')),
38+
'prefix' => '',
39+
'prefix_indexes' => null,
40+
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
41+
'busy_timeout' => null,
42+
'journal_mode' => null,
43+
'synchronous' => null,
44+
],
45+
46+
'mysql' => [
47+
'driver' => 'mysql',
48+
'url' => env('DB_URL'),
49+
'host' => env('DB_HOST', '127.0.0.1'),
50+
'port' => env('DB_PORT', '3306'),
51+
'database' => env('DB_DATABASE', 'laravel'),
52+
'username' => env('DB_USERNAME', 'root'),
53+
'password' => env('DB_PASSWORD', ''),
54+
'unix_socket' => env('DB_SOCKET', ''),
55+
'charset' => env('DB_CHARSET', 'utf8mb4'),
56+
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
57+
'prefix' => '',
58+
'prefix_indexes' => true,
59+
'strict' => true,
60+
'engine' => null,
61+
'options' => extension_loaded('pdo_mysql') ? array_filter([
62+
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
63+
]) : [],
64+
],
65+
66+
'mariadb' => [
67+
'driver' => 'mariadb',
68+
'url' => env('DB_URL'),
69+
'host' => env('DB_HOST', '127.0.0.1'),
70+
'port' => env('DB_PORT', '3306'),
71+
'database' => env('DB_DATABASE', 'laravel'),
72+
'username' => env('DB_USERNAME', 'root'),
73+
'password' => env('DB_PASSWORD', ''),
74+
'unix_socket' => env('DB_SOCKET', ''),
75+
'charset' => env('DB_CHARSET', 'utf8mb4'),
76+
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
77+
'prefix' => '',
78+
'prefix_indexes' => true,
79+
'strict' => true,
80+
'engine' => null,
81+
'options' => extension_loaded('pdo_mysql') ? array_filter([
82+
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
83+
]) : [],
84+
],
85+
86+
'pgsql' => [
87+
'driver' => 'pgsql',
88+
'url' => env('DB_URL'),
89+
'host' => env('DB_HOST', '127.0.0.1'),
90+
'port' => env('DB_PORT', '5432'),
91+
'database' => env('DB_DATABASE', 'laravel'),
92+
'username' => env('DB_USERNAME', 'root'),
93+
'password' => env('DB_PASSWORD', ''),
94+
'charset' => env('DB_CHARSET', 'utf8'),
95+
'prefix' => '',
96+
'prefix_indexes' => true,
97+
'search_path' => env('DB_SEARCH_PATH', 'public'),
98+
'sslmode' => 'prefer',
99+
],
100+
101+
'sqlsrv' => [
102+
'driver' => 'sqlsrv',
103+
'url' => env('DB_URL'),
104+
'host' => env('DB_HOST', 'localhost'),
105+
'port' => env('DB_PORT', '1433'),
106+
'database' => env('DB_DATABASE', 'laravel'),
107+
'username' => env('DB_USERNAME', 'root'),
108+
'password' => env('DB_PASSWORD', ''),
109+
'charset' => env('DB_CHARSET', 'utf8'),
110+
'prefix' => '',
111+
'prefix_indexes' => true,
112+
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
113+
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
114+
],
115+
116+
],
117+
118+
/*
119+
|--------------------------------------------------------------------------
120+
| Migration Repository Table
121+
|--------------------------------------------------------------------------
122+
|
123+
| This table keeps track of all the migrations that have already run for
124+
| your application. Using this information, we can determine which of
125+
| the migrations on disk haven't actually been run on the database.
126+
|
127+
*/
128+
5129
'migrations' => [
6130
'table' => 'migrations',
7-
'update_date_on_publish' => false, // disable to preserve original behavior for existing applications
131+
'update_date_on_publish' => true,
132+
],
133+
134+
/*
135+
|--------------------------------------------------------------------------
136+
| Redis Databases
137+
|--------------------------------------------------------------------------
138+
|
139+
| Redis is an open source, fast, and advanced key-value store that also
140+
| provides a richer body of commands than a typical key-value system
141+
| such as Memcached. You may define your connection settings here.
142+
|
143+
*/
144+
145+
'redis' => [
146+
147+
'client' => env('REDIS_CLIENT', 'phpredis'),
148+
149+
'options' => [
150+
'cluster' => env('REDIS_CLUSTER', 'redis'),
151+
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
152+
'persistent' => env('REDIS_PERSISTENT', false),
153+
],
154+
155+
'default' => [
156+
'url' => env('REDIS_URL'),
157+
'host' => env('REDIS_HOST', '127.0.0.1'),
158+
'username' => env('REDIS_USERNAME'),
159+
'password' => env('REDIS_PASSWORD'),
160+
'port' => env('REDIS_PORT', '6379'),
161+
'database' => env('REDIS_DB', '0'),
162+
],
163+
164+
'cache' => [
165+
'url' => env('REDIS_URL'),
166+
'host' => env('REDIS_HOST', '127.0.0.1'),
167+
'username' => env('REDIS_USERNAME'),
168+
'password' => env('REDIS_PASSWORD'),
169+
'port' => env('REDIS_PORT', '6379'),
170+
'database' => env('REDIS_CACHE_DB', '1'),
171+
],
172+
8173
],
9174

10175
];

0 commit comments

Comments
 (0)