Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. database.php<?php
  2.  
  3. return [
  4.  
  5. /*
  6. |--------------------------------------------------------------------------
  7. | Default Database Connection Name
  8. |--------------------------------------------------------------------------
  9. |
  10. | Here you may specify which of the database connections below you wish
  11. | to use as your default connection for all database work. Of course
  12. | you may use many connections at once using the Database library.
  13. |
  14. */
  15.  
  16. 'default' => env('DB_CONNECTION', 'mysql'),
  17.  
  18. /*
  19. |--------------------------------------------------------------------------
  20. | Database Connections
  21. |--------------------------------------------------------------------------
  22. |
  23. | Here are each of the database connections setup for your application.
  24. | Of course, examples of configuring each database platform that is
  25. | supported by Laravel is shown below to make development simple.
  26. |
  27. |
  28. | All database work in Laravel is done through the PHP PDO facilities
  29. | so make sure you have the driver for your particular database of
  30. | choice installed on your machine before you begin development.
  31. |
  32. */
  33.  
  34. 'connections' => [
  35.  
  36. 'sqlite' => [
  37. 'driver' => 'sqlite',
  38. 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  39. 'prefix' => '',
  40. ],
  41.  
  42. 'mysql' => [
  43. 'driver' => 'mysql',
  44. 'host' => env('DB_HOST', '127.0.0.1'),
  45. 'port' => env('DB_PORT', '3306'),
  46. 'database' => env('DB_DATABASE', 'forge'),
  47. 'username' => env('DB_USERNAME', 'forge'),
  48. 'password' => env('DB_PASSWORD', ''),
  49. 'unix_socket' => env('DB_SOCKET', ''),
  50. 'charset' => 'utf8mb4',
  51. 'collation' => 'utf8mb4_unicode_ci',
  52. 'prefix' => '',
  53. 'strict' => true,
  54. 'engine' => null,
  55. ],
  56.  
  57. 'pgsql' => [
  58. 'driver' => 'pgsql',
  59. 'host' => env('DB_HOST', '127.0.0.1'),
  60. 'port' => env('DB_PORT', '5432'),
  61. 'database' => env('DB_DATABASE', 'forge'),
  62. 'username' => env('DB_USERNAME', 'forge'),
  63. 'password' => env('DB_PASSWORD', ''),
  64. 'charset' => 'utf8',
  65. 'prefix' => '',
  66. 'schema' => 'public',
  67. 'sslmode' => 'prefer',
  68. ],
  69.  
  70. 'sqlsrv' => [
  71. 'driver' => 'sqlsrv',
  72. 'host' => env('DB_HOST', 'localhost'),
  73. 'port' => env('DB_PORT', '1433'),
  74. 'database' => env('DB_DATABASE', 'forge'),
  75. 'username' => env('DB_USERNAME', 'forge'),
  76. 'password' => env('DB_PASSWORD', ''),
  77. 'charset' => 'utf8',
  78. 'prefix' => '',
  79. ],
  80.  
  81. ],
  82.  
  83. /*
  84. |--------------------------------------------------------------------------
  85. | Migration Repository Table
  86. |--------------------------------------------------------------------------
  87. |
  88. | This table keeps track of all the migrations that have already run for
  89. | your application. Using this information, we can determine which of
  90. | the migrations on disk haven't actually been run in the database.
  91. |
  92. */
  93.  
  94. 'migrations' => 'migrations',
  95.  
  96. /*
  97. |--------------------------------------------------------------------------
  98. | Redis Databases
  99. |--------------------------------------------------------------------------
  100. |
  101. | Redis is an open source, fast, and advanced key-value store that also
  102. | provides a richer set of commands than a typical key-value systems
  103. | such as APC or Memcached. Laravel makes it easy to dig right in.
  104. |
  105. */
  106.  
  107. 'redis' => [
  108.  
  109. 'client' => 'predis',
  110.  
  111. 'default' => [
  112. 'host' => env('REDIS_HOST', '127.0.0.1'),
  113. 'password' => env('REDIS_PASSWORD', null),
  114. 'port' => env('REDIS_PORT', 6379),
  115. 'database' => 0,
  116. ],
  117.  
  118. ],
  119.  
  120. ];
  121.  
  122. .env
  123.  
  124. DB_CONNECTION=mysql
  125. DB_HOST=127.0.0.1
  126. DB_PORT=3306
  127. DB_DATABASE=test_laravel
  128. DB_USERNAME=root
  129. DB_PASSWORD=Sipalica
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement