LaravelTest

Форк
0
/
database.php 
170 строк · 5.9 Кб
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
        ],
41

42
        'mysql' => [
43
            'driver' => 'mysql',
44
            'url' => env('DB_URL'),
45
            'host' => env('DB_HOST', '127.0.0.1'),
46
            'port' => env('DB_PORT', '3306'),
47
            'database' => env('DB_DATABASE', 'laravel'),
48
            'username' => env('DB_USERNAME', 'root'),
49
            'password' => env('DB_PASSWORD', ''),
50
            'unix_socket' => env('DB_SOCKET', ''),
51
            'charset' => env('DB_CHARSET', 'utf8mb4'),
52
            'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
53
            'prefix' => '',
54
            'prefix_indexes' => true,
55
            'strict' => true,
56
            'engine' => null,
57
            'options' => extension_loaded('pdo_mysql') ? array_filter([
58
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
59
            ]) : [],
60
        ],
61

62
        'mariadb' => [
63
            'driver' => 'mariadb',
64
            'url' => env('DB_URL'),
65
            'host' => env('DB_HOST', '127.0.0.1'),
66
            'port' => env('DB_PORT', '3306'),
67
            'database' => env('DB_DATABASE', 'laravel'),
68
            'username' => env('DB_USERNAME', 'root'),
69
            'password' => env('DB_PASSWORD', ''),
70
            'unix_socket' => env('DB_SOCKET', ''),
71
            'charset' => env('DB_CHARSET', 'utf8mb4'),
72
            'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
73
            'prefix' => '',
74
            'prefix_indexes' => true,
75
            'strict' => true,
76
            'engine' => null,
77
            'options' => extension_loaded('pdo_mysql') ? array_filter([
78
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
79
            ]) : [],
80
        ],
81

82
        'pgsql' => [
83
            'driver' => 'pgsql',
84
            'url' => env('DB_URL'),
85
            'host' => env('DB_HOST', '127.0.0.1'),
86
            'port' => env('DB_PORT', '5432'),
87
            'database' => env('DB_DATABASE', 'laravel'),
88
            'username' => env('DB_USERNAME', 'root'),
89
            'password' => env('DB_PASSWORD', ''),
90
            'charset' => env('DB_CHARSET', 'utf8'),
91
            'prefix' => '',
92
            'prefix_indexes' => true,
93
            'search_path' => 'public',
94
            'sslmode' => 'prefer',
95
        ],
96

97
        'sqlsrv' => [
98
            'driver' => 'sqlsrv',
99
            'url' => env('DB_URL'),
100
            'host' => env('DB_HOST', 'localhost'),
101
            'port' => env('DB_PORT', '1433'),
102
            'database' => env('DB_DATABASE', 'laravel'),
103
            'username' => env('DB_USERNAME', 'root'),
104
            'password' => env('DB_PASSWORD', ''),
105
            'charset' => env('DB_CHARSET', 'utf8'),
106
            'prefix' => '',
107
            'prefix_indexes' => true,
108
            // 'encrypt' => env('DB_ENCRYPT', 'yes'),
109
            // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
110
        ],
111

112
    ],
113

114
    /*
115
    |--------------------------------------------------------------------------
116
    | Migration Repository Table
117
    |--------------------------------------------------------------------------
118
    |
119
    | This table keeps track of all the migrations that have already run for
120
    | your application. Using this information, we can determine which of
121
    | the migrations on disk haven't actually been run on the database.
122
    |
123
    */
124

125
    'migrations' => [
126
        'table' => 'migrations',
127
        'update_date_on_publish' => true,
128
    ],
129

130
    /*
131
    |--------------------------------------------------------------------------
132
    | Redis Databases
133
    |--------------------------------------------------------------------------
134
    |
135
    | Redis is an open source, fast, and advanced key-value store that also
136
    | provides a richer body of commands than a typical key-value system
137
    | such as Memcached. You may define your connection settings here.
138
    |
139
    */
140

141
    'redis' => [
142

143
        'client' => env('REDIS_CLIENT', 'phpredis'),
144

145
        'options' => [
146
            'cluster' => env('REDIS_CLUSTER', 'redis'),
147
            'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
148
        ],
149

150
        'default' => [
151
            'url' => env('REDIS_URL'),
152
            'host' => env('REDIS_HOST', '127.0.0.1'),
153
            'username' => env('REDIS_USERNAME'),
154
            'password' => env('REDIS_PASSWORD'),
155
            'port' => env('REDIS_PORT', '6379'),
156
            'database' => env('REDIS_DB', '0'),
157
        ],
158

159
        'cache' => [
160
            'url' => env('REDIS_URL'),
161
            'host' => env('REDIS_HOST', '127.0.0.1'),
162
            'username' => env('REDIS_USERNAME'),
163
            'password' => env('REDIS_PASSWORD'),
164
            'port' => env('REDIS_PORT', '6379'),
165
            'database' => env('REDIS_CACHE_DB', '1'),
166
        ],
167

168
    ],
169

170
];
171

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.