comparison config/database.php @ 0:9d7dcd54c677

Initial Commit and package setup
author luka
date Sat, 23 Aug 2025 22:20:51 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:9d7dcd54c677
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 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 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
40 'busy_timeout' => null,
41 'journal_mode' => null,
42 'synchronous' => null,
43 ],
44
45 'mysql' => [
46 'driver' => 'mysql',
47 'url' => env('DB_URL'),
48 'host' => env('DB_HOST', '127.0.0.1'),
49 'port' => env('DB_PORT', '3306'),
50 'database' => env('DB_DATABASE', 'laravel'),
51 'username' => env('DB_USERNAME', 'root'),
52 'password' => env('DB_PASSWORD', ''),
53 'unix_socket' => env('DB_SOCKET', ''),
54 'charset' => env('DB_CHARSET', 'utf8mb4'),
55 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
56 'prefix' => '',
57 'prefix_indexes' => true,
58 'strict' => true,
59 'engine' => null,
60 'options' => extension_loaded('pdo_mysql') ? array_filter([
61 PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
62 ]) : [],
63 ],
64
65 'mariadb' => [
66 'driver' => 'mariadb',
67 'url' => env('DB_URL'),
68 'host' => env('DB_HOST', '127.0.0.1'),
69 'port' => env('DB_PORT', '3306'),
70 'database' => env('DB_DATABASE', 'laravel'),
71 'username' => env('DB_USERNAME', 'root'),
72 'password' => env('DB_PASSWORD', ''),
73 'unix_socket' => env('DB_SOCKET', ''),
74 'charset' => env('DB_CHARSET', 'utf8mb4'),
75 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
76 'prefix' => '',
77 'prefix_indexes' => true,
78 'strict' => true,
79 'engine' => null,
80 'options' => extension_loaded('pdo_mysql') ? array_filter([
81 PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
82 ]) : [],
83 ],
84
85 'pgsql' => [
86 'driver' => 'pgsql',
87 'url' => env('DB_URL'),
88 'host' => env('DB_HOST', '127.0.0.1'),
89 'port' => env('DB_PORT', '5432'),
90 'database' => env('DB_DATABASE', 'laravel'),
91 'username' => env('DB_USERNAME', 'root'),
92 'password' => env('DB_PASSWORD', ''),
93 'charset' => env('DB_CHARSET', 'utf8'),
94 'prefix' => '',
95 'prefix_indexes' => true,
96 'search_path' => 'public',
97 'sslmode' => 'prefer',
98 ],
99
100 'sqlsrv' => [
101 'driver' => 'sqlsrv',
102 'url' => env('DB_URL'),
103 'host' => env('DB_HOST', 'localhost'),
104 'port' => env('DB_PORT', '1433'),
105 'database' => env('DB_DATABASE', 'laravel'),
106 'username' => env('DB_USERNAME', 'root'),
107 'password' => env('DB_PASSWORD', ''),
108 'charset' => env('DB_CHARSET', 'utf8'),
109 'prefix' => '',
110 'prefix_indexes' => true,
111 // 'encrypt' => env('DB_ENCRYPT', 'yes'),
112 // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
113 ],
114
115 ],
116
117 /*
118 |--------------------------------------------------------------------------
119 | Migration Repository Table
120 |--------------------------------------------------------------------------
121 |
122 | This table keeps track of all the migrations that have already run for
123 | your application. Using this information, we can determine which of
124 | the migrations on disk haven't actually been run on the database.
125 |
126 */
127
128 'migrations' => [
129 'table' => 'migrations',
130 'update_date_on_publish' => true,
131 ],
132
133 /*
134 |--------------------------------------------------------------------------
135 | Redis Databases
136 |--------------------------------------------------------------------------
137 |
138 | Redis is an open source, fast, and advanced key-value store that also
139 | provides a richer body of commands than a typical key-value system
140 | such as Memcached. You may define your connection settings here.
141 |
142 */
143
144 'redis' => [
145
146 'client' => env('REDIS_CLIENT', 'phpredis'),
147
148 'options' => [
149 'cluster' => env('REDIS_CLUSTER', 'redis'),
150 'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-database-'),
151 'persistent' => env('REDIS_PERSISTENT', false),
152 ],
153
154 'default' => [
155 'url' => env('REDIS_URL'),
156 'host' => env('REDIS_HOST', '127.0.0.1'),
157 'username' => env('REDIS_USERNAME'),
158 'password' => env('REDIS_PASSWORD'),
159 'port' => env('REDIS_PORT', '6379'),
160 'database' => env('REDIS_DB', '0'),
161 ],
162
163 'cache' => [
164 'url' => env('REDIS_URL'),
165 'host' => env('REDIS_HOST', '127.0.0.1'),
166 'username' => env('REDIS_USERNAME'),
167 'password' => env('REDIS_PASSWORD'),
168 'port' => env('REDIS_PORT', '6379'),
169 'database' => env('REDIS_CACHE_DB', '1'),
170 ],
171
172 ],
173
174 ];