From 3e1869f7e683816e5bdbaf1ba8018178af42caf5 Mon Sep 17 00:00:00 2001 From: Laravel Shift Date: Sun, 14 Feb 2021 02:39:22 +0000 Subject: [PATCH] Default config files In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used. --- config/auth.php | 15 ++++--- config/cache.php | 8 ++-- config/database.php | 93 +++++++++++++++++++----------------------- config/filesystems.php | 12 ++---- config/mail.php | 4 +- config/queue.php | 44 +++++++++++++++----- config/services.php | 6 +-- config/session.php | 19 +++++++-- 8 files changed, 115 insertions(+), 86 deletions(-) diff --git a/config/auth.php b/config/auth.php index eeaec2f6..78175010 100644 --- a/config/auth.php +++ b/config/auth.php @@ -12,10 +12,12 @@ return [ | as required, but they're a perfect start for most applications. | */ + 'defaults' => [ 'guard' => 'web', 'passwords' => 'users', ], + /* |-------------------------------------------------------------------------- | Authentication Guards @@ -32,16 +34,19 @@ return [ | Supported: "session", "token" | */ + 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], + 'api' => [ 'driver' => 'token', 'provider' => 'users', ], ], + /* |-------------------------------------------------------------------------- | User Providers @@ -58,25 +63,24 @@ return [ | Supported: "database", "eloquent" | */ + 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\Models\User::class, + 'model' => App\User::class, ], + // 'users' => [ // 'driver' => 'database', // 'table' => 'users', // ], ], + /* |-------------------------------------------------------------------------- | Resetting Passwords |-------------------------------------------------------------------------- | - | Here you may set the options for resetting passwords including the view - | that is your password reset e-mail. You may also set the name of the - | table that maintains all of the reset tokens for your application. - | | You may specify multiple password reset configurations if you have more | than one user table or model in the application and you want to have | separate password reset settings based on the specific user types. @@ -86,6 +90,7 @@ return [ | they have less time to be guessed. You may change this as needed. | */ + 'passwords' => [ 'users' => [ 'provider' => 'users', diff --git a/config/cache.php b/config/cache.php index e025fbf6..fa12e5e4 100644 --- a/config/cache.php +++ b/config/cache.php @@ -15,7 +15,7 @@ return [ | */ - 'default' => env('CACHE_DRIVER', 'database'), + 'default' => env('CACHE_DRIVER', 'file'), /* |-------------------------------------------------------------------------- @@ -40,13 +40,13 @@ return [ 'database' => [ 'driver' => 'database', - 'table' => 'cache', + 'table' => 'cache', 'connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), + 'path' => storage_path('framework/cache/data'), ], 'memcached' => [ @@ -88,7 +88,7 @@ return [ 'prefix' => env( 'CACHE_PREFIX', - 'ponyfm_' + str_slug(env('APP_NAME', 'laravel'), '_').'_cache' ), ]; diff --git a/config/database.php b/config/database.php index 66ec8210..cab5d068 100644 --- a/config/database.php +++ b/config/database.php @@ -13,7 +13,7 @@ return [ | */ - 'default' => env('DB_CONNECTION', 'pgsql'), + 'default' => env('DB_CONNECTION', 'mysql'), /* |-------------------------------------------------------------------------- @@ -34,49 +34,48 @@ return [ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', - 'database' => storage_path('database.sqlite'), - 'prefix' => '', - ], - - 'memory' => [ - 'driver' => 'sqlite', - 'database' => ':memory:', - 'prefix' => '', + 'driver' => 'sqlite', + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', ], 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', 'localhost'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'strict' => false, - ], - - 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('POSTGRESQL_DB_HOST', 'localhost'), - 'database' => env('POSTGRESQL_DB_DATABASE', 'homestead'), - 'username' => env('POSTGRESQL_DB_USERNAME', 'homestead'), - 'password' => env('POSTGRESQL_DB_PASSWORD', 'secret'), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', - ], - - 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'host' => env('DB_HOST', 'localhost'), + 'driver' => 'mysql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'strict' => true, + 'engine' => null, + ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + 'sslmode' => 'prefer', + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', ], ], @@ -109,19 +108,11 @@ return [ 'client' => 'predis', - 'options' => [ - 'cluster' => 'redis', - ], - - 'clusters' => [ - 'default' => [ - [ - 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), - 'database' => 0, - ], - ], + 'default' => [ + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', 6379), + 'database' => 0, ], ], diff --git a/config/filesystems.php b/config/filesystems.php index 74119768..77fa5ded 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -13,7 +13,7 @@ return [ | */ - 'default' => env('FILESYSTEM_DRIVER', 'local'), + 'default' => env('FILESYSTEM_DRIVER', 'local'), /* |-------------------------------------------------------------------------- @@ -37,7 +37,7 @@ return [ | may even configure multiple disks of the same driver. Defaults have | been setup for each driver as an example of the required options. | - | Supported Drivers: "local", "ftp", "s3", "rackspace" + | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" | */ @@ -45,12 +45,7 @@ return [ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), - ], - - 'testing' => [ - 'driver' => 'local', - 'root' => storage_path('app').'/test-files', + 'root' => storage_path('app'), ], 'public' => [ @@ -66,6 +61,7 @@ return [ 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION'), 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), ], ], diff --git a/config/mail.php b/config/mail.php index c4a5e44f..bb92224c 100644 --- a/config/mail.php +++ b/config/mail.php @@ -56,8 +56,8 @@ return [ */ 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', 'hello@pony.fm'), - 'name' => env('MAIL_FROM_NAME', 'Pony.fm'), + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', 'Example'), ], /* diff --git a/config/queue.php b/config/queue.php index 8a2efbe7..391304f3 100644 --- a/config/queue.php +++ b/config/queue.php @@ -4,15 +4,12 @@ return [ /* |-------------------------------------------------------------------------- - | Default Queue Driver + | Default Queue Connection Name |-------------------------------------------------------------------------- | - | The Laravel queue API supports a variety of back-ends via an unified + | Laravel's queue API supports an assortment of back-ends via a single | API, giving you convenient access to each back-end using the same - | syntax for each one. Here you may set the default queue driver. - | - | Supported: "null", "sync", "database", "beanstalkd", - | "sqs", "iron", "redis" + | syntax for every one. Here you may define a default connection. | */ @@ -27,6 +24,8 @@ return [ | is used by your application. A default configuration has been added | for each back-end shipped with Laravel. You are free to add more. | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | */ 'connections' => [ @@ -35,11 +34,35 @@ return [ 'driver' => 'sync', ], + 'database' => [ + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', + 'retry_after' => 90, + ], + 'beanstalkd' => [ 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'retry_after' => 60, + 'host' => 'localhost', + 'queue' => 'default', + 'retry_after' => 90, + ], + + 'sqs' => [ + 'driver' => 'sqs', + 'key' => env('SQS_KEY', 'your-public-key'), + 'secret' => env('SQS_SECRET', 'your-secret-key'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'region' => env('SQS_REGION', 'us-east-1'), + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => 'default', + 'retry_after' => 90, + 'block_for' => null, ], ], @@ -56,7 +79,8 @@ return [ */ 'failed' => [ - 'database' => 'pgsql', 'table' => 'failed_jobs', + 'database' => env('DB_CONNECTION', 'mysql'), + 'table' => 'failed_jobs', ], ]; diff --git a/config/services.php b/config/services.php index 85dd29ca..aa1f7f82 100644 --- a/config/services.php +++ b/config/services.php @@ -8,7 +8,7 @@ return [ |-------------------------------------------------------------------------- | | This file is for storing the credentials for third party services such - | as Stripe, Mailgun, Mandrill, and others. This file provides a sane + | as Stripe, Mailgun, SparkPost and others. This file provides a sane | default location for this type of information, allowing packages | to have a conventional place to find your various credentials. | @@ -22,7 +22,7 @@ return [ 'ses' => [ 'key' => env('SES_KEY'), 'secret' => env('SES_SECRET'), - 'region' => 'us-east-1', + 'region' => env('SES_REGION', 'us-east-1'), ], 'sparkpost' => [ @@ -30,7 +30,7 @@ return [ ], 'stripe' => [ - 'model' => App\Models\User::class, + 'model' => App\User::class, 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], diff --git a/config/session.php b/config/session.php index 2b321223..736fb3c7 100644 --- a/config/session.php +++ b/config/session.php @@ -16,7 +16,7 @@ return [ | */ - 'driver' => env('SESSION_DRIVER', 'database'), + 'driver' => env('SESSION_DRIVER', 'file'), /* |-------------------------------------------------------------------------- @@ -85,6 +85,19 @@ return [ 'table' => 'sessions', + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using the "apc" or "memcached" session drivers, you may specify a + | cache store that should be used for these sessions. This value must + | correspond with one of the application's configured cache stores. + | + */ + + 'store' => null, + /* |-------------------------------------------------------------------------- | Session Sweeping Lottery @@ -111,7 +124,7 @@ return [ 'cookie' => env( 'SESSION_COOKIE', - 'IfYouAreReadingThisWeWantToWorkWithYou_PleaseDropAnEmailTo_HelloAtPoniverseDotNet' + str_slug(env('APP_NAME', 'laravel'), '_').'_session' ), /* @@ -151,7 +164,7 @@ return [ | */ - 'secure' => env('SESSION_HTTPS_ONLY', true), + 'secure' => env('SESSION_SECURE_COOKIE', false), /* |--------------------------------------------------------------------------