3 // REDIS - Split out configuration into an array
4 if (env('REDIS_SERVERS', false)) {
5 $redisServerKeys = ['host', 'port', 'database'];
6 $redisServers = explode(',', trim(env('REDIS_SERVERS', '127.0.0.1:6379:0'), ','));
8 'cluster' => env('REDIS_CLUSTER', false)
10 foreach ($redisServers as $index => $redisServer) {
11 $redisServerName = ($index === 0) ? 'default' : 'redis-server-' . $index;
12 $redisServerDetails = explode(':', $redisServer);
13 if (count($redisServerDetails) < 2) $redisServerDetails[] = '6379';
14 if (count($redisServerDetails) < 3) $redisServerDetails[] = '0';
15 $redisConfig[$redisServerName] = array_combine($redisServerKeys, $redisServerDetails);
19 $mysql_host = env('DB_HOST', 'localhost');
20 $mysql_host_exploded = explode(':', $mysql_host);
21 $mysql_port = env('DB_PORT', 3306);
22 if (count($mysql_host_exploded) > 1) {
23 $mysql_host = $mysql_host_exploded[0];
24 $mysql_port = intval($mysql_host_exploded[1]);
30 |--------------------------------------------------------------------------
32 |--------------------------------------------------------------------------
34 | By default, database results will be returned as instances of the PHP
35 | stdClass object; however, you may desire to retrieve records in an
36 | array format for simplicity. Here you can tweak the fetch style.
40 'fetch' => PDO::FETCH_CLASS,
43 |--------------------------------------------------------------------------
44 | Default Database Connection Name
45 |--------------------------------------------------------------------------
47 | Here you may specify which of the database connections below you wish
48 | to use as your default connection for all database work. Of course
49 | you may use many connections at once using the Database library.
53 'default' => env('DB_CONNECTION', 'mysql'),
56 |--------------------------------------------------------------------------
57 | Database Connections
58 |--------------------------------------------------------------------------
60 | Here are each of the database connections setup for your application.
61 | Of course, examples of configuring each database platform that is
62 | supported by Laravel is shown below to make development simple.
65 | All database work in Laravel is done through the PHP PDO facilities
66 | so make sure you have the driver for your particular database of
67 | choice installed on your machine before you begin development.
75 'database' => storage_path('database.sqlite'),
81 'host' => $mysql_host,
82 'database' => env('DB_DATABASE', 'forge'),
83 'username' => env('DB_USERNAME', 'forge'),
84 'password' => env('DB_PASSWORD', ''),
85 'port' => $mysql_port,
86 'charset' => 'utf8mb4',
87 'collation' => 'utf8mb4_unicode_ci',
94 'host' => '127.0.0.1',
95 'database' => 'bookstack-test',
96 'username' => env('MYSQL_USER', 'bookstack-test'),
97 'password' => env('MYSQL_PASSWORD', 'bookstack-test'),
99 'collation' => 'utf8_unicode_ci',
106 'host' => env('DB_HOST', 'localhost'),
107 'database' => env('DB_DATABASE', 'forge'),
108 'username' => env('DB_USERNAME', 'forge'),
109 'password' => env('DB_PASSWORD', ''),
112 'schema' => 'public',
116 'driver' => 'sqlsrv',
117 'host' => env('DB_HOST', 'localhost'),
118 'database' => env('DB_DATABASE', 'forge'),
119 'username' => env('DB_USERNAME', 'forge'),
120 'password' => env('DB_PASSWORD', ''),
128 |--------------------------------------------------------------------------
129 | Migration Repository Table
130 |--------------------------------------------------------------------------
132 | This table keeps track of all the migrations that have already run for
133 | your application. Using this information, we can determine which of
134 | the migrations on disk haven't actually been run in the database.
138 'migrations' => 'migrations',
141 |--------------------------------------------------------------------------
143 |--------------------------------------------------------------------------
145 | Redis is an open source, fast, and advanced key-value store that also
146 | provides a richer set of commands than a typical key-value systems
147 | such as APC or Memcached. Laravel makes it easy to dig right in.
151 'redis' => env('REDIS_SERVERS', false) ? $redisConfig : [],