From 6bd31f36581de9b1f26118ac297ee8277e767712 Mon Sep 17 00:00:00 2001 From: Laravel Shift Date: Mon, 11 Mar 2019 06:57:47 +0000 Subject: [PATCH 1/5] Shift configuration --- config/app.php | 2 ++ config/cache.php | 20 ++++++++++++++------ config/database.php | 15 +++++++++++++-- config/logging.php | 17 +++++++++++++++-- config/mail.php | 13 +++++++++++++ config/queue.php | 9 +++++---- config/services.php | 15 ++++++++++++--- config/session.php | 12 +++++++----- config/view.php | 5 ++++- 9 files changed, 85 insertions(+), 23 deletions(-) diff --git a/config/app.php b/config/app.php index 39e03ea..8bd7a5d 100644 --- a/config/app.php +++ b/config/app.php @@ -176,6 +176,7 @@ 'aliases' => [ 'App' => Illuminate\Support\Facades\App::class, + 'Arr' => Illuminate\Support\Arr::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, 'Blade' => Illuminate\Support\Facades\Blade::class, @@ -205,6 +206,7 @@ 'Schema' => Illuminate\Support\Facades\Schema::class, 'Session' => Illuminate\Support\Facades\Session::class, 'Storage' => Illuminate\Support\Facades\Storage::class, + 'Str' => Illuminate\Support\Str::class, 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, diff --git a/config/cache.php b/config/cache.php index 6c4629d..4976722 100644 --- a/config/cache.php +++ b/config/cache.php @@ -1,5 +1,7 @@ [ - // Memcached::OPT_CONNECT_TIMEOUT => 2000, + // Memcached::OPT_CONNECT_TIMEOUT => 2000, ], 'servers' => [ [ @@ -73,6 +76,14 @@ 'connection' => 'cache', ], + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + ], + ], /* @@ -86,9 +97,6 @@ | */ - 'prefix' => env( - 'CACHE_PREFIX', - str_slug(env('APP_NAME', 'laravel'), '_').'_cache' - ), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), ]; diff --git a/config/database.php b/config/database.php index c60c885..77c3184 100644 --- a/config/database.php +++ b/config/database.php @@ -37,6 +37,7 @@ 'driver' => 'sqlite', 'database' => env('DB_DATABASE', database_path('database.sqlite')), 'prefix' => '', + 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), ], 'mysql' => [ @@ -50,8 +51,12 @@ 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', + 'prefix_indexes' => true, 'strict' => true, 'engine' => null, + 'options' => array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]), ], 'pgsql' => [ @@ -63,6 +68,7 @@ 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'prefix' => '', + 'prefix_indexes' => true, 'schema' => 'public', 'sslmode' => 'prefer', ], @@ -76,6 +82,7 @@ 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'prefix' => '', + 'prefix_indexes' => true, ], ], @@ -99,14 +106,18 @@ |-------------------------------------------------------------------------- | | Redis is an open source, fast, and advanced key-value store that also - | provides a richer set of commands than a typical key-value systems + | provides a richer body of commands than a typical key-value system | such as APC or Memcached. Laravel makes it easy to dig right in. | */ 'redis' => [ - 'client' => 'predis', + 'client' => env('REDIS_CLIENT', 'predis'), + + 'options' => [ + 'cluster' => env('REDIS_CLUSTER', 'predis'), + ], 'default' => [ 'host' => env('REDIS_HOST', '127.0.0.1'), diff --git a/config/logging.php b/config/logging.php index 400bc7f..d09cd7d 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,6 +1,7 @@ [ 'stack' => [ 'driver' => 'stack', - 'channels' => ['single'], + 'channels' => ['daily'], + 'ignore_exceptions' => false, ], 'single' => [ @@ -48,7 +50,7 @@ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), 'level' => 'debug', - 'days' => 7, + 'days' => 14, ], 'slack' => [ @@ -59,9 +61,20 @@ 'level' => 'critical', ], + 'papertrail' => [ + 'driver' => 'monolog', + 'level' => 'debug', + 'handler' => SyslogUdpHandler::class, + 'handler_with' => [ + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), + ], + ], + 'stderr' => [ 'driver' => 'monolog', 'handler' => StreamHandler::class, + 'formatter' => env('LOG_STDERR_FORMATTER'), 'with' => [ 'stream' => 'php://stderr', ], diff --git a/config/mail.php b/config/mail.php index bb92224..f400645 100644 --- a/config/mail.php +++ b/config/mail.php @@ -120,4 +120,17 @@ ], ], + /* + |-------------------------------------------------------------------------- + | Log Channel + |-------------------------------------------------------------------------- + | + | If you are using the "log" driver, you may specify the logging channel + | if you prefer to keep mail messages separate from other log entries + | for simpler reading. Otherwise, the default channel will be used. + | + */ + + 'log_channel' => env('MAIL_LOG_CHANNEL'), + ]; diff --git a/config/queue.php b/config/queue.php index 38326ef..ec520ec 100644 --- a/config/queue.php +++ b/config/queue.php @@ -46,21 +46,22 @@ 'host' => 'localhost', 'queue' => 'default', 'retry_after' => 90, + 'block_for' => 0, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => env('SQS_KEY', 'your-public-key'), - 'secret' => env('SQS_SECRET', 'your-secret-key'), + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_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'), + 'region' => env('AWS_REGION', 'us-east-1'), ], 'redis' => [ 'driver' => 'redis', 'connection' => 'default', - 'queue' => 'default', + 'queue' => env('REDIS_QUEUE', 'default'), 'retry_after' => 90, 'block_for' => null, ], diff --git a/config/services.php b/config/services.php index aa1f7f8..e546cbf 100644 --- a/config/services.php +++ b/config/services.php @@ -17,12 +17,17 @@ 'mailgun' => [ 'domain' => env('MAILGUN_DOMAIN'), 'secret' => env('MAILGUN_SECRET'), + 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), + ], + + 'postmark' => [ + 'token' => env('POSTMARK_TOKEN'), ], 'ses' => [ - 'key' => env('SES_KEY'), - 'secret' => env('SES_SECRET'), - 'region' => env('SES_REGION', 'us-east-1'), + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_REGION', 'us-east-1'), ], 'sparkpost' => [ @@ -33,6 +38,10 @@ 'model' => App\User::class, 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), + 'webhook' => [ + 'secret' => env('STRIPE_WEBHOOK_SECRET'), + 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), + ], ], ]; diff --git a/config/session.php b/config/session.php index 38829b7..fbb9b4d 100644 --- a/config/session.php +++ b/config/session.php @@ -1,5 +1,7 @@ env( 'SESSION_COOKIE', - str_slug(env('APP_NAME', 'laravel'), '_').'_session' + Str::slug(env('APP_NAME', 'laravel'), '_').'_session' ), /* diff --git a/config/view.php b/config/view.php index 2acfd9c..22b8a18 100644 --- a/config/view.php +++ b/config/view.php @@ -28,6 +28,9 @@ | */ - 'compiled' => realpath(storage_path('framework/views')), + 'compiled' => env( + 'VIEW_COMPILED_PATH', + realpath(storage_path('framework/views')) + ), ]; From ebb94208786be5f836806902f585e27c29841039 Mon Sep 17 00:00:00 2001 From: Laravel Shift Date: Mon, 11 Mar 2019 06:57:47 +0000 Subject: [PATCH 2/5] Shift deprecated helpers Laravel recommends using the `Str` and `Arr` class methods directly instead of the respective helper functions. These helper functions are [deprecated in Laravel 5.8][1] and will be removed in a future version. [1]: https://github.com/laravel/framework/pull/26898 --- database/factories/UserFactory.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 061d75a..1a9535d 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -1,5 +1,6 @@ $faker->name, 'email' => $faker->unique()->safeEmail, 'password' => $password ?: $password = bcrypt('secret'), - 'remember_token' => str_random(10), + 'remember_token' => Str::random(10), ]; }); From 39d4a1a15e8cfbdf9ef7f94e0032f8b72fc93f45 Mon Sep 17 00:00:00 2001 From: Laravel Shift Date: Mon, 11 Mar 2019 06:57:47 +0000 Subject: [PATCH 3/5] Shift Laravel dependencies --- composer.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 50d4feb..7c5dd59 100644 --- a/composer.json +++ b/composer.json @@ -16,16 +16,16 @@ "botman/studio-addons": "~1.3", "botman/tinker": "~1.0", "fideloper/proxy": "^4.0", - "laravel/framework": "5.7.*", + "laravel/framework": "5.8.*", "laravel/tinker": "^1.0" }, "require-dev": { "beyondcode/laravel-dump-server": "^1.0", - "filp/whoops": "~2.0", - "fzaninotto/faker": "~1.4", + "filp/whoops": "^2.0", + "fzaninotto/faker": "^1.4", "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^7.5" }, "autoload": { "classmap": [ @@ -43,8 +43,7 @@ }, "extra": { "laravel": { - "dont-discover": [ - ] + "dont-discover": [] } }, "scripts": { From 4639f6708b43d07f64e9e49d2237bd84f8e75d0a Mon Sep 17 00:00:00 2001 From: Kostiantyn Bozhko Date: Mon, 11 Mar 2019 09:07:24 +0200 Subject: [PATCH 4/5] Update `app.php` config file to Laravel 5.8 version. --- config/app.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/app.php b/config/app.php index 8bd7a5d..959587f 100644 --- a/config/app.php +++ b/config/app.php @@ -54,6 +54,8 @@ 'url' => env('APP_URL', 'http://localhost'), + 'asset_url' => env('ASSET_URL', null), + /* |-------------------------------------------------------------------------- | Application Timezone @@ -93,6 +95,19 @@ 'fallback_locale' => 'en', + /* + |-------------------------------------------------------------------------- + | Faker Locale + |-------------------------------------------------------------------------- + | + | This locale will be used by the Faker PHP library when generating fake + | data for your database seeds. For example, this will be used to get + | localized telephone numbers, street address information and more. + | + */ + + 'faker_locale' => 'en_US', + /* |-------------------------------------------------------------------------- | Encryption Key From 1bce95d44a6f96aed15644fd0e0fe3ee1b0f8397 Mon Sep 17 00:00:00 2001 From: Kostiantyn Bozhko Date: Mon, 11 Mar 2019 22:26:15 +0200 Subject: [PATCH 5/5] Bump `botman/studio-addons` version. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7c5dd59..b2a60ee 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": "^7.1.3", "botman/botman": "~2.0", "botman/driver-web": "~1.0", - "botman/studio-addons": "~1.3", + "botman/studio-addons": "~1.5", "botman/tinker": "~1.0", "fideloper/proxy": "^4.0", "laravel/framework": "5.8.*", @@ -73,4 +73,4 @@ }, "minimum-stability": "dev", "prefer-stable": true -} \ No newline at end of file +}