From d37b47462548c6a64e92476c34f753bf0ecc0c96 Mon Sep 17 00:00:00 2001 From: nikhiltri Date: Fri, 14 Jul 2023 14:48:42 -0500 Subject: [PATCH] Review Laravel upgrade guide [API-381] --- .env.example | 2 +- .../Commands/Import/ImportProductsFull.php | 5 + app/Library/Migrations/MigrationCreator.php | 13 +-- app/Transformers/Traits/ConvertsToHtml.php | 29 ++++-- config/app.php | 27 +++++- config/auth.php | 6 +- config/broadcasting.php | 8 +- config/cache.php | 9 ++ config/database.php | 20 +--- config/elasticsearch.php | 24 ++--- config/filesystems.php | 6 +- config/hashing.php | 6 +- config/horizon.php | 94 ------------------- config/logging.php | 20 +++- config/mail.php | 4 +- config/queue.php | 93 ++++++++++++++++++ config/sanctum.php | 18 +++- config/scout.php | 5 + config/sentry.php | 34 ++++++- config/services.php | 24 ++--- config/session.php | 18 ++-- {resources/lang => lang}/en/auth.php | 0 {resources/lang => lang}/en/pagination.php | 0 {resources/lang => lang}/en/passwords.php | 0 {resources/lang => lang}/en/validation.php | 0 25 files changed, 285 insertions(+), 180 deletions(-) delete mode 100644 config/horizon.php create mode 100644 config/queue.php rename {resources/lang => lang}/en/auth.php (100%) rename {resources/lang => lang}/en/pagination.php (100%) rename {resources/lang => lang}/en/passwords.php (100%) rename {resources/lang => lang}/en/validation.php (100%) diff --git a/.env.example b/.env.example index 9dd5bcafe..77e4b4a7e 100644 --- a/.env.example +++ b/.env.example @@ -30,7 +30,7 @@ CACHE_DRIVER='memcached' SESSION_DRIVER='memcached' MEMCACHED_HOST='memcache.test' -FILESYSTEM_DRIVER='local' +FILESYSTEM_DISK='local' # One-time configs on first deploy: DB_CONNECTION='mysql' diff --git a/app/Console/Commands/Import/ImportProductsFull.php b/app/Console/Commands/Import/ImportProductsFull.php index bbb2fdddd..954983b9f 100644 --- a/app/Console/Commands/Import/ImportProductsFull.php +++ b/app/Console/Commands/Import/ImportProductsFull.php @@ -3,6 +3,7 @@ namespace App\Console\Commands\Import; use Illuminate\Support\Facades\Storage; +use Illuminate\Contracts\Filesystem\FileNotFoundException; use League\Csv\Reader; class ImportProductsFull extends AbstractImportCommand @@ -17,6 +18,10 @@ public function handle() // API-344: Make sure this matches upload filename in ProductController $stream = Storage::disk('s3')->getDriver()->readStream('DatahubChainDriveProductData.csv'); + if (!$stream) { + throw new FileNotFoundException(); + } + $csv = Reader::createFromStream($stream); $csv->setHeaderOffset(0); diff --git a/app/Library/Migrations/MigrationCreator.php b/app/Library/Migrations/MigrationCreator.php index 8fd69faee..31e52a5d4 100644 --- a/app/Library/Migrations/MigrationCreator.php +++ b/app/Library/Migrations/MigrationCreator.php @@ -35,13 +35,14 @@ protected function getStub($table, $create) return $this->files->get($stubPath); } - protected function populateStub($name, $stub, $table) + protected function populateStub($stub, $table) { - $stub = str_replace( - ['DummyClass', '{{ class }}', '{{class}}'], - $this->getClassName($name), - $stub - ); + if (! is_null($table)) { + $stub = str_replace( + ['DummyTable', '{{ table }}', '{{table}}'], + $table, $stub + ); + } if (!empty($this->stubPopulator)) { $stub = ($this->stubPopulator)($stub); diff --git a/app/Transformers/Traits/ConvertsToHtml.php b/app/Transformers/Traits/ConvertsToHtml.php index a2cbdef07..77fef68c5 100644 --- a/app/Transformers/Traits/ConvertsToHtml.php +++ b/app/Transformers/Traits/ConvertsToHtml.php @@ -2,22 +2,31 @@ namespace App\Transformers\Traits; -use League\CommonMark\CommonMarkConverter; +use League\CommonMark\MarkdownConverter; +use League\CommonMark\Environment; +use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; +use League\CommonMark\Extension\Table\TableExtension; trait ConvertsToHtml { private $htmlConverter; + private $config = [ + 'renderer' => [ + 'soft_break' => '
', + ], + ]; + + private function getEnvironment() { + $environment = Environment::createCommonMarkEnvironment(); + $environment->addExtension(new CommonMarkCoreExtension()); + $environment->addExtension(new TableExtension()); + $environment->mergeConfig($this->config); + return $environment; + } - /** - * TODO: Consider moving this into a MarkdownServiceProvider? - */ private function getHtmlConverter() { - return $this->htmlConverter ?? $this->htmlConverter = new CommonMarkConverter([ - 'renderer' => [ - 'soft_break' => '
', - ], - ]); + return $this->htmlConverter ?? $this->htmlConverter = new MarkdownConverter($this->getEnvironment()); } /** @@ -27,6 +36,6 @@ private function getHtmlConverter() */ private function convertToHtml($value) { - return isset($value) ? $this->getHtmlConverter()->convertToHtml($value) : null; + return isset($value) ? $this->getHtmlConverter()->convertToHtml($value)->getContent() : null; } } diff --git a/config/app.php b/config/app.php index f56f16504..46142f354 100644 --- a/config/app.php +++ b/config/app.php @@ -1,5 +1,7 @@ env('APP_URL', 'http://localhost'), - 'asset_url' => env('ASSET_URL', null), + 'asset_url' => env('ASSET_URL'), /* |-------------------------------------------------------------------------- @@ -120,6 +122,24 @@ 'cipher' => 'AES-256-CBC', + /* + |-------------------------------------------------------------------------- + | Maintenance Mode Driver + |-------------------------------------------------------------------------- + | + | These configuration options determine the driver used to determine and + | manage Laravel's "maintenance mode" status. The "cache" driver will + | allow maintenance mode to be controlled across multiple machines. + | + | Supported drivers: "file", "cache" + | + */ + + 'maintenance' => [ + 'driver' => 'file', + // 'store' => 'redis', + ], + /* |-------------------------------------------------------------------------- | Autoloaded Service Providers @@ -200,7 +220,7 @@ | */ - 'aliases' => [ + 'aliases' => Facade::defaultAliases()->merge([ 'App' => Illuminate\Support\Facades\App::class, 'Arr' => Illuminate\Support\Arr::class, @@ -242,7 +262,6 @@ 'View' => Illuminate\Support\Facades\View::class, 'Elasticsearch' => MailerLite\LaravelElasticsearch\Facade::class, - - ], + ])->toArray(), ]; diff --git a/config/auth.php b/config/auth.php index 822e65376..ef89735d2 100644 --- a/config/auth.php +++ b/config/auth.php @@ -72,10 +72,14 @@ | than one user table or model in the application and you want to have | separate password reset settings based on the specific user types. | - | The expire time is the number of minutes that the reset token should be + | The expire time is the number of minutes that each reset token will be | considered valid. This security feature keeps tokens short-lived so | they have less time to be guessed. You may change this as needed. | + | The throttle setting is the number of seconds a user must wait before + | generating more password reset tokens. This prevents the user from + | quickly generating a very large amount of password reset tokens. + | */ 'passwords' => [ // Our User model has no password diff --git a/config/broadcasting.php b/config/broadcasting.php index 55cc3bbf9..1a4eb4e30 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -35,8 +35,14 @@ 'secret' => env('PUSHER_APP_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'cluster' => env('PUSHER_APP_CLUSTER'), + 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', + 'port' => env('PUSHER_PORT', 443), + 'scheme' => env('PUSHER_SCHEME', 'https'), 'encrypted' => true, + 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', + ], + 'client_options' => [ + // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html ], ], 'ably' => [ diff --git a/config/cache.php b/config/cache.php index a8d7e6b92..8f337f9e9 100644 --- a/config/cache.php +++ b/config/cache.php @@ -79,6 +79,15 @@ 'lock_connection' => 'default', ], + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), + ], + 'octane' => [ 'driver' => 'octane', ], diff --git a/config/database.php b/config/database.php index 0fbc121c1..3fd3a54d1 100644 --- a/config/database.php +++ b/config/database.php @@ -75,7 +75,7 @@ 'charset' => 'utf8', 'prefix' => env('DB_PREFIX', ''), 'prefix_indexes' => true, - 'schema' => 'public', + 'search_path' => 'public', 'sslmode' => 'prefer', ], @@ -90,6 +90,8 @@ 'charset' => 'utf8', 'prefix' => env('DB_PREFIX', ''), 'prefix_indexes' => true, + // 'encrypt' => env('DB_ENCRYPT', 'yes'), + // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), ], ], @@ -106,20 +108,6 @@ 'migrations' => 'migrations', - /* - |-------------------------------------------------------------------------- - | Column Types - |-------------------------------------------------------------------------- - | This allows for modifying `timestamp` columns in migrations. - | See https://laravel.com/docs/8.x/migrations#prerequisites. - */ - - 'dbal' => [ - 'types' => [ - 'timestamp' => TimestampType::class, - ], - ], - /* |-------------------------------------------------------------------------- | Redis Databases @@ -143,6 +131,7 @@ 'default' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), + 'username' => env('REDIS_USERNAME'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), @@ -151,6 +140,7 @@ 'cache' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), + 'username' => env('REDIS_USERNAME'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), diff --git a/config/elasticsearch.php b/config/elasticsearch.php index fbebb02e2..37bd0b557 100644 --- a/config/elasticsearch.php +++ b/config/elasticsearch.php @@ -41,24 +41,24 @@ 'hosts' => [ [ - 'host' => env('ELASTICSEARCH_HOST', 'localhost'), + 'host' => env('ELASTICSEARCH_HOST', 'localhost'), // For local development, the default Elasticsearch port is 9200. // If you are connecting to an Elasticsearch instance on AWS, you probably want to set this to null - 'port' => env('ELASTICSEARCH_PORT', 9200), - 'scheme' => env('ELASTICSEARCH_SCHEME', null), - 'user' => env('ELASTICSEARCH_USER', null), - 'pass' => env('ELASTICSEARCH_PASS', null), + 'port' => env('ELASTICSEARCH_PORT', 9200), + 'scheme' => env('ELASTICSEARCH_SCHEME', null), + 'user' => env('ELASTICSEARCH_USER', null), + 'pass' => env('ELASTICSEARCH_PASS', null), // Alternatively, you can log in via API keys - 'api_id' => env('ELASTICSEARCH_API_ID', null), - 'api_key' => env('ELASTICSEARCH_API_KEY', null), + 'api_id' => env('ELASTICSEARCH_API_ID', null), + 'api_key' => env('ELASTICSEARCH_API_KEY', null), // If you are connecting to an Elasticsearch instance on AWS, you will need these values as well - 'aws' => env('AWS_ELASTICSEARCH_ENABLED', false), - 'aws_region' => env('AWS_REGION', ''), - 'aws_key' => env('AWS_ACCESS_KEY_ID', ''), - 'aws_secret' => env('AWS_SECRET_ACCESS_KEY', ''), - 'aws_credentials' => null, + 'aws' => env('AWS_ELASTICSEARCH_ENABLED', false), + 'aws_region' => env('AWS_REGION', ''), + 'aws_key' => env('AWS_ACCESS_KEY_ID', ''), + 'aws_secret' => env('AWS_SECRET_ACCESS_KEY', ''), + 'aws_credentials' => null, 'aws_session_token' => env('AWS_SESSION_TOKEN', null), ], ], diff --git a/config/filesystems.php b/config/filesystems.php index af13286d1..4d589b598 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -13,7 +13,7 @@ | */ - 'default' => env('FILESYSTEM_DRIVER', 'local'), + 'default' => env('FILESYSTEM_DISK', 'local'), /* |-------------------------------------------------------------------------- @@ -33,11 +33,13 @@ 'local' => [ 'driver' => 'local', 'root' => storage_path('app'), + 'throw' => false, ], 'dumps' => [ 'driver' => 'local', 'root' => storage_path('dumps'), + 'throw' => false, ], 'public' => [ @@ -45,6 +47,7 @@ 'root' => storage_path('app/public'), 'url' => env('APP_URL') . '/storage', 'visibility' => 'public', + 'throw' => false, ], 's3' => [ @@ -56,6 +59,7 @@ 'url' => env('AWS_URL'), 'endpoint' => env('AWS_ENDPOINT'), 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), + 'throw' => false, ], ], diff --git a/config/hashing.php b/config/hashing.php index 00ed9e74d..d89be2938 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -38,8 +38,8 @@ | */ 'argon' => [ - 'memory' => 1024, - 'threads' => 2, - 'time' => 2, + 'memory' => 65536, + 'threads' => 1, + 'time' => 4, ], ]; diff --git a/config/horizon.php b/config/horizon.php deleted file mode 100644 index fcfed7200..000000000 --- a/config/horizon.php +++ /dev/null @@ -1,94 +0,0 @@ - 'default', - - /* - |-------------------------------------------------------------------------- - | Horizon Redis Prefix - |-------------------------------------------------------------------------- - | - | This prefix will be used when storing all Horizon data in Redis. You - | may modify the prefix when you are running multiple installations - | of Horizon on the same server so that they don't have problems. - | - */ - - 'prefix' => env('HORIZON_PREFIX', 'horizon:'), - - /* - |-------------------------------------------------------------------------- - | Queue Wait Time Thresholds - |-------------------------------------------------------------------------- - | - | This option allows you to configure when the LongWaitDetected event - | will be fired. Every connection / queue combination may have its - | own, unique threshold (in seconds) before this event is fired. - | - */ - - 'waits' => [ - 'redis:default' => 60, - ], - - /* - |-------------------------------------------------------------------------- - | Job Trimming Times - |-------------------------------------------------------------------------- - | - | Here you can configure for how long (in minutes) you desire Horizon to - | persist the recent and failed jobs. Typically, recent jobs are kept - | for one hour while all failed jobs are stored for an entire week. - | - */ - - 'trim' => [ - 'recent' => 60, - 'failed' => 10080, - ], - - /* - |-------------------------------------------------------------------------- - | Queue Worker Configuration - |-------------------------------------------------------------------------- - | - | Here you may define the queue worker settings used by your application - | in all environments. These supervisors and settings handle all your - | queued jobs and will be provisioned by Horizon during deployment. - | - */ - - 'environments' => [ - 'production' => [ - 'supervisor-1' => [ - 'connection' => 'redis', - 'queue' => ['default'], - 'balance' => 'simple', - 'processes' => 10, - 'tries' => 3, - ], - ], - - 'local' => [ - 'supervisor-1' => [ - 'connection' => 'redis', - 'queue' => ['default'], - 'balance' => 'simple', - 'processes' => 3, - 'tries' => 3, - ], - ], - ], -]; diff --git a/config/logging.php b/config/logging.php index 19f7f9085..7150c85a7 100644 --- a/config/logging.php +++ b/config/logging.php @@ -2,6 +2,7 @@ use Monolog\Handler\NullHandler; use Monolog\Handler\StreamHandler; +use Monolog\Handler\SyslogUdpHandler; return [ /* @@ -27,7 +28,10 @@ | */ - 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'deprecations' => [ + 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'trace' => false, + ], /* |-------------------------------------------------------------------------- @@ -47,6 +51,7 @@ 'stack' => [ 'driver' => 'stack', 'channels' => ['single'], + 'ignore_exceptions' => false, ], 'single' => [ 'driver' => 'single', @@ -57,7 +62,7 @@ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'debug'), - 'days' => 7, + 'days' => 14, ], 'slack' => [ 'driver' => 'slack', @@ -66,10 +71,21 @@ 'emoji' => ':boom:', 'level' => env('LOG_LEVEL', 'critical'), ], + 'papertrail' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), + 'handler_with' => [ + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), + ], + ], 'stderr' => [ 'driver' => 'monolog', 'level' => env('LOG_LEVEL', 'debug'), 'handler' => StreamHandler::class, + 'formatter' => env('LOG_STDERR_FORMATTER'), 'with' => [ 'stream' => 'php://stderr', ], diff --git a/config/mail.php b/config/mail.php index 9920e3709..be1dd82a3 100644 --- a/config/mail.php +++ b/config/mail.php @@ -41,7 +41,7 @@ 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'timeout' => null, - 'auth_mode' => null, + 'local_domain' => env('MAIL_EHLO_DOMAIN'), ], 'ses' => [ @@ -58,7 +58,7 @@ 'sendmail' => [ 'transport' => 'sendmail', - 'path' => '/usr/sbin/sendmail -bs', + 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), ], 'log' => [ diff --git a/config/queue.php b/config/queue.php new file mode 100644 index 000000000..25ea5a819 --- /dev/null +++ b/config/queue.php @@ -0,0 +1,93 @@ + env('QUEUE_CONNECTION', 'sync'), + + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection information for each server that + | 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' => [ + + 'sync' => [ + 'driver' => 'sync', + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', + 'retry_after' => 90, + 'after_commit' => false, + ], + + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', + 'retry_after' => 90, + 'block_for' => 0, + 'after_commit' => false, + ], + + 'sqs' => [ + 'driver' => 'sqs', + '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', 'default'), + 'suffix' => env('SQS_SUFFIX'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'after_commit' => false, + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => env('REDIS_QUEUE', 'default'), + 'retry_after' => 90, + 'block_for' => null, + 'after_commit' => false, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control which database and table are used to store the jobs that + | have failed. You may change them to any database / table you wish. + | + */ + + 'failed' => [ + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), + 'database' => env('DB_CONNECTION', 'mysql'), + 'table' => 'failed_jobs', + ], + +]; diff --git a/config/sanctum.php b/config/sanctum.php index 3c92b7ae2..529cfdc99 100644 --- a/config/sanctum.php +++ b/config/sanctum.php @@ -1,5 +1,7 @@ explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( '%s%s', 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', - env('APP_URL') ? ',' . parse_url(env('APP_URL'), PHP_URL_HOST) : '' + Sanctum::currentApplicationUrlWithPort() ))), + /* + |-------------------------------------------------------------------------- + | Sanctum Guards + |-------------------------------------------------------------------------- + | + | This array contains the authentication guards that will be checked when + | Sanctum is trying to authenticate a request. If none of these guards + | are able to authenticate the request, Sanctum will use the bearer + | token that's present on an incoming request for authentication. + | + */ + + 'guard' => ['web'], + /* |-------------------------------------------------------------------------- | Expiration Minutes diff --git a/config/scout.php b/config/scout.php index 001267938..5fa4b3819 100644 --- a/config/scout.php +++ b/config/scout.php @@ -132,6 +132,11 @@ 'meilisearch' => [ 'host' => env('MEILISEARCH_HOST', 'http://localhost:7700'), 'key' => env('MEILISEARCH_KEY', null), + 'index-settings' => [ + // 'users' => [ + // 'filterableAttributes'=> ['id', 'name', 'email'], + // ], + ], ], /* diff --git a/config/sentry.php b/config/sentry.php index 0653bfb89..d22d881ce 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -4,7 +4,7 @@ 'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), // capture release as git sha - // 'release' => trim(exec('git log --pretty="%h" -n1 HEAD')), + 'release' => trim(exec('git log --pretty="%h" -n1 HEAD')), // When left empty or `null` the Laravel environment will be used 'environment' => env('SENTRY_ENVIRONMENT'), @@ -13,6 +13,12 @@ // Capture Laravel logs in breadcrumbs 'logs' => true, + // Capture Laravel cache events in breadcrumbs + 'cache' => true, + + // // Capture Livewire components in breadcrumbs + // 'livewire' => true, + // Capture SQL queries in breadcrumbs 'sql_queries' => true, @@ -24,6 +30,9 @@ // Capture command information in breadcrumbs 'command_info' => true, + + // Capture HTTP client requests information in breadcrumbs + 'http_client_requests' => true, ], 'tracing' => [ @@ -42,14 +51,31 @@ // Capture views as spans 'views' => true, + // // Capture Livewire components as spans + // 'livewire' => true, + + // Capture HTTP client requests as spans + 'http_client_requests' => true, + + // // Capture Redis operations as spans (this enables Redis events in Laravel) + // 'redis_commands' => env('SENTRY_TRACE_REDIS_COMMANDS', false), + + // // Try to find out where the Redis command originated from and add it to the command spans + // 'redis_origin' => true, + // Indicates if the tracing integrations supplied by Sentry should be loaded 'default_integrations' => true, + + // Indicates that requests without a matching route should be traced + 'missing_routes' => false, ], // @see: https://docs.sentry.io/platforms/php/configuration/options/#send-default-pii - 'send_default_pii' => false, + 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate + 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_TRACES_SAMPLE_RATE'), - 'traces_sample_rate' => (float) (env('SENTRY_TRACES_SAMPLE_RATE', 0.0)), + 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_PROFILES_SAMPLE_RATE'), - 'controllers_base_namespace' => env('SENTRY_CONTROLLERS_BASE_NAMESPACE', 'App\\Http\\Controllers'), ]; diff --git a/config/services.php b/config/services.php index 2d91d6534..0ace530e8 100644 --- a/config/services.php +++ b/config/services.php @@ -8,31 +8,27 @@ |-------------------------------------------------------------------------- | | This file is for storing the credentials for third party services such - | as Stripe, Mailgun, Postmark, AWS and more. This file provides the de facto + | as Mailgun, Postmark, AWS and more. This file provides the de facto | location for this type of information, allowing packages to have - | a conventional place to find your various credentials. + | a conventional file to locate the various service credentials. | */ 'mailgun' => [ 'domain' => env('MAILGUN_DOMAIN'), 'secret' => env('MAILGUN_SECRET'), + 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), + 'scheme' => 'https', ], - 'ses' => [ - 'key' => env('SES_KEY'), - 'secret' => env('SES_SECRET'), - 'region' => 'us-east-1', + 'postmark' => [ + 'token' => env('POSTMARK_TOKEN'), ], - 'stripe' => [ - 'model' => null, - 'key' => env('STRIPE_KEY'), - 'secret' => env('STRIPE_SECRET'), + 'ses' => [ + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], - 'google_tag_manager' => [ - 'enabled' => (bool) env('GTM_ENABLED', false), - 'id' => env('GTM_ID', '') - ], ]; diff --git a/config/session.php b/config/session.php index b99cc2063..8fed97c01 100644 --- a/config/session.php +++ b/config/session.php @@ -14,7 +14,7 @@ | you may specify any of the other wonderful drivers provided here. | | Supported: "file", "cookie", "database", "apc", - | "memcached", "redis", "array" + | "memcached", "redis", "dynamodb", "array" | */ @@ -72,7 +72,7 @@ | */ - 'connection' => null, + 'connection' => env('SESSION_CONNECTION'), /* |-------------------------------------------------------------------------- @@ -93,14 +93,14 @@ |-------------------------------------------------------------------------- | | While using one of the framework's cache driven session backends you may - | cache store that should be used for these sessions. This value must - | correspond with one of the application's configured cache stores. + | list a cache store that should be used for these sessions. This value + | must match with one of the application's configured cache "stores". | | Affects: "apc", "dynamodb", "memcached", "redis" | */ - 'store' => env('SESSION_STORE', null), + 'store' => env('SESSION_STORE'), /* |-------------------------------------------------------------------------- @@ -128,7 +128,7 @@ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_') . '_session' + Str::slug(env('APP_NAME', 'laravel'), '_').'_session' ), /* @@ -155,7 +155,7 @@ | */ - 'domain' => env('SESSION_DOMAIN', null), + 'domain' => env('SESSION_DOMAIN'), /* |-------------------------------------------------------------------------- @@ -164,11 +164,11 @@ | | By setting this option to true, session cookies will only be sent back | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you if it can not be done securely. + | the cookie from being sent to you when it can't be done securely. | */ - 'secure' => env('SESSION_SECURE_COOKIE', null), + 'secure' => env('SESSION_SECURE_COOKIE'), /* |-------------------------------------------------------------------------- diff --git a/resources/lang/en/auth.php b/lang/en/auth.php similarity index 100% rename from resources/lang/en/auth.php rename to lang/en/auth.php diff --git a/resources/lang/en/pagination.php b/lang/en/pagination.php similarity index 100% rename from resources/lang/en/pagination.php rename to lang/en/pagination.php diff --git a/resources/lang/en/passwords.php b/lang/en/passwords.php similarity index 100% rename from resources/lang/en/passwords.php rename to lang/en/passwords.php diff --git a/resources/lang/en/validation.php b/lang/en/validation.php similarity index 100% rename from resources/lang/en/validation.php rename to lang/en/validation.php