diff --git a/.env.example b/.env.example index 0864c8b0..e0b290da 100644 --- a/.env.example +++ b/.env.example @@ -39,7 +39,7 @@ DB_USERNAME=wod DB_PASSWORD=password DB_FORWARD_PORT=5444 -CACHE_DRIVER=file +CACHE_STORE=file FILESYSTEM_DISK=local QUEUE_CONNECTION=sync SESSION_DRIVER=file diff --git a/app/config/app.php b/app/config/app.php index 74cdb242..97b4b725 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -9,10 +9,9 @@ /* * Application Name * - * This value is the name of your application. This value is used when the + * This value is the name of your application, which will be used when the * framework needs to place the application's name in a notification or - * any other location as required by the application or its packages. - * + * other UI elements where an application name needs to be displayed. */ 'name' => env('APP_NAME', 'Laravel'), @@ -22,7 +21,6 @@ * This value determines the "environment" your application is currently * running in. This may determine how you prefer to configure various * services the application utilizes. Set this in your ".env" file. - * */ 'env' => env('APP_ENV', 'production'), @@ -32,7 +30,6 @@ * When your application is in debug mode, detailed error messages with * stack traces will be shown on every error that occurs within your * application. If disabled, a simple generic error page is shown. - * */ 'debug' => (bool) env('APP_DEBUG', false), @@ -41,19 +38,18 @@ * * This URL is used by the console to properly generate URLs when using * the Artisan command line tool. You should set this to the root of - * your application so that it is used when running Artisan tasks. - * + * the application so that it's available within Artisan commands. */ 'url' => env('APP_URL', 'http://localhost'), + 'frontend_url' => env('FRONTEND_URL', 'http://localhost:3000'), 'asset_url' => env('ASSET_URL'), /* * Application Timezone * * Here you may specify the default timezone for your application, which - * will be used by the PHP date and date-time functions. We have gone - * ahead and set this to a sensible default for you out of the box. - * + * will be used by the PHP date and date-time functions. The timezone + * is set to "UTC" by default as it is suitable for most use cases. */ 'timezone' => env('APP_TIMEZONE', 'UTC'), @@ -61,42 +57,27 @@ * Application Locale Configuration * * The application locale determines the default locale that will be used - * by the translation service provider. You are free to set this value - * to any of the locales which will be supported by the application. - * - */ - 'locale' => 'en', - - /* - * Application Fallback Locale - * - * The fallback locale determines the locale to use when the current one - * is not available. You may change the value to correspond to any of - * the language folders that are provided through your application. - * + * by Laravel's translation / localization methods. This option can be + * set to any locale for which you plan to have translation strings. */ - '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', + 'locale' => env('APP_LOCALE', 'en'), + 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), + 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), /* * Encryption Key * - * This key is used by the Illuminate encrypter service and should be set - * to a random, 32 character string, otherwise these encrypted strings - * will not be safe. Please do this before deploying an application! - * + * This key is utilized by Laravel's encryption services and should be set + * to a random, 32 character string to ensure that all encrypted values + * are secure. You should do this prior to deploying the application. */ - 'key' => env('APP_KEY'), 'cipher' => 'AES-256-CBC', + 'key' => env('APP_KEY'), + 'previous_keys' => [ + ...array_filter( + explode(',', env('APP_PREVIOUS_KEYS', '')) + ), + ], /* * Maintenance Mode Driver @@ -106,11 +87,10 @@ * allow maintenance mode to be controlled across multiple machines. * * Supported drivers: "file", "cache" - * */ 'maintenance' => [ - 'driver' => 'file', - // 'store' => 'redis', + 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), + 'store' => env('APP_MAINTENANCE_STORE', 'database'), ], /* @@ -119,7 +99,6 @@ * The service providers listed here will be automatically loaded on the * request to your application. Feel free to add your own services to * this array to grant expanded functionality to your applications. - * */ 'providers' => ServiceProvider::defaultProviders()->merge([ /* diff --git a/app/config/auth.php b/app/config/auth.php index d7c374fd..12c9a611 100644 --- a/app/config/auth.php +++ b/app/config/auth.php @@ -6,13 +6,13 @@ /* * Authentication Defaults * - * This option controls the default authentication "guard" and password - * reset options for your application. You may change these defaults + * This option defines the default authentication "guard" and password + * reset "broker" for your application. You may change these values * as required, but they're a perfect start for most applications. */ 'defaults' => [ - 'guard' => 'web', - 'passwords' => 'users', + 'guard' => env('AUTH_GUARD', 'web'), + 'passwords' => env('AUTH_PASSWORD_BROKER', 'users'), ], /* @@ -20,14 +20,13 @@ * * Next, you may define every authentication guard for your application. * Of course, a great default configuration has been defined for you - * here which uses session storage and the Eloquent user provider. + * which utilizes session storage plus the Eloquent user provider. * - * All authentication drivers have a user provider. This defines how the + * All authentication guards have a user provider, which defines how the * users are actually retrieved out of your database or other storage - * mechanisms used by this application to persist your user's data. + * system used by the application. Typically, Eloquent is utilized. * * Supported: "session" - * */ 'guards' => [ 'web' => [ @@ -39,21 +38,20 @@ /* * User Providers * - * All authentication drivers have a user provider. This defines how the + * All authentication guards have a user provider, which defines how the * users are actually retrieved out of your database or other storage - * mechanisms used by this application to persist your user's data. + * system used by the application. Typically, Eloquent is utilized. * * If you have multiple user tables or models you may configure multiple - * sources which represent each model / table. These sources may then + * providers to represent the model / table. These providers may then * be assigned to any extra authentication guards you have defined. * * Supported: "database", "eloquent" - * */ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => Domain\User\Models\User::class, + 'model' => env('AUTH_MODEL', Domain\User\Models\User::class), ], // 'users' => [ @@ -65,9 +63,9 @@ /* * Resetting Passwords * - * 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. + * These configuration options specify the behavior of Laravel's password + * reset functionality, including the table utilized for token storage + * and the user provider that is invoked to actually retrieve users. * * The expiry time is the number of minutes that each reset token will be * considered valid. This security feature keeps tokens short-lived so @@ -76,12 +74,11 @@ * 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' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_reset_tokens', + 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'), 'expire' => 60, 'throttle' => 60, ], @@ -91,9 +88,8 @@ * Password Confirmation Timeout * * Here you may define the amount of seconds before a password confirmation - * times out and the user is prompted to re-enter their password via the + * window expires and users are asked to re-enter their password via the * confirmation screen. By default, the timeout lasts for three hours. - * */ - 'password_timeout' => 10800, + 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800), ]; diff --git a/app/config/cache.php b/app/config/cache.php index f6389615..820e400a 100644 --- a/app/config/cache.php +++ b/app/config/cache.php @@ -11,9 +11,8 @@ * This option controls the default cache connection that gets used while * using this caching library. This connection is used when another is * not explicitly specified when executing a given caching function. - * */ - 'default' => env('CACHE_DRIVER', 'file'), + 'default' => env('CACHE_STORE', 'file'), /* * Cache Stores @@ -22,15 +21,10 @@ * well as their drivers. You may even define multiple stores for the * same cache driver to group types of items stored in your caches. * - * Supported drivers: "apc", "array", "database", "file", + * Supported drivers: "array", "database", "file", * "memcached", "redis", "dynamodb", "octane", "null" - * */ 'stores' => [ - 'apc' => [ - 'driver' => 'apc', - ], - 'array' => [ 'driver' => 'array', 'serialize' => false, @@ -38,14 +32,15 @@ 'database' => [ 'driver' => 'database', - 'table' => 'cache', - 'connection' => null, - 'lock_connection' => null, + 'table' => env('DB_CACHE_TABLE', 'cache'), + 'connection' => env('DB_CACHE_CONNECTION'), + 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), ], 'file' => [ 'driver' => 'file', 'path' => storage_path('framework/cache/data'), + 'lock_path' => storage_path('framework/cache/data'), ], 'memcached' => [ @@ -69,8 +64,8 @@ 'redis' => [ 'driver' => 'redis', - 'connection' => 'cache', - 'lock_connection' => 'default', + 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), + 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), ], 'dynamodb' => [ @@ -93,7 +88,6 @@ * When utilizing the APC, database, memcached, Redis, or DynamoDB cache * stores there might be other applications using the same cache. For * that reason, you may prefix every cache key to avoid collisions. - * */ 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'), ]; diff --git a/app/config/database.php b/app/config/database.php index d36af59e..31cd2559 100644 --- a/app/config/database.php +++ b/app/config/database.php @@ -9,29 +9,23 @@ * Default Database Connection Name * * Here you may specify which of the database connections below you wish - * to use as your default connection for all database work. Of course - * you may use many connections at once using the Database library. - * + * to use as your default connection for database operations. This is + * the connection which will be utilized unless another connection + * is explicitly specified when you execute a query / statement. */ - 'default' => env('DB_CONNECTION', 'mysql'), + 'default' => env('DB_CONNECTION', 'sqlite'), /* * Database Connections * - * Here are each of the database connections setup for your application. - * Of course, examples of configuring each database platform that is - * supported by Laravel is shown below to make development simple. - * - * - * All database work in Laravel is done through the PHP PDO facilities - * so make sure you have the driver for your particular database of - * choice installed on your machine before you begin development. - * + * Below are all the database connections defined for your application. + * An example configuration is provided for each database system which + * is supported by Laravel. You're free to add / remove connections. */ 'connections' => [ 'sqlite' => [ 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), + 'url' => env('DB_URL'), 'database' => env('DB_DATABASE', database_path('database.sqlite')), 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), @@ -39,15 +33,35 @@ 'mysql' => [ 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'mariadb' => [ + 'driver' => 'mariadb', + 'url' => env('DB_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 'prefix' => '', 'prefix_indexes' => true, 'strict' => true, @@ -59,13 +73,13 @@ 'pgsql' => [ 'driver' => 'pgsql', - 'url' => env('DATABASE_URL'), + 'url' => env('DB_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '5432'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', + 'charset' => env('DB_CHARSET', 'utf8'), 'prefix' => '', 'prefix_indexes' => true, 'search_path' => 'public', @@ -74,13 +88,13 @@ 'sqlsrv' => [ 'driver' => 'sqlsrv', - 'url' => env('DATABASE_URL'), + 'url' => env('DB_URL'), 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', + 'charset' => env('DB_CHARSET', 'utf8'), 'prefix' => '', 'prefix_indexes' => true, // 'encrypt' => env('DB_ENCRYPT', 'yes'), @@ -93,18 +107,19 @@ * * This table keeps track of all the migrations that have already run for * your application. Using this information, we can determine which of - * the migrations on disk haven't actually been run in the database. - * + * the migrations on disk haven't actually been run on the database. */ - 'migrations' => 'migrations', + 'migrations' => [ + 'table' => 'migrations', + 'update_date_on_publish' => true, + ], /* * Redis Databases * * Redis is an open source, fast, and advanced key-value store that also * 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. - * + * such as Memcached. You may define your connection settings here. */ 'redis' => [ 'client' => env('REDIS_CLIENT', 'phpredis'), diff --git a/app/config/filesystems.php b/app/config/filesystems.php index ecb066e3..49e04807 100644 --- a/app/config/filesystems.php +++ b/app/config/filesystems.php @@ -8,20 +8,18 @@ * * Here you may specify the default filesystem disk that should be used * by the framework. The "local" disk, as well as a variety of cloud - * based disks are available to your application. Just store away! - * + * based disks are available to your application for file storage. */ 'default' => env('FILESYSTEM_DISK', 'local'), /* * Filesystem Disks * - * Here you may configure as many filesystem "disks" as you wish, and you - * may even configure multiple disks of the same driver. Defaults have - * been set up for each driver as an example of the required values. + * Below you may configure as many filesystem disks as necessary, and you + * may even configure multiple disks for the same driver. Examples for + * most supported storage drivers are configured here for reference. * * Supported Drivers: "local", "ftp", "sftp", "s3" - * */ 'disks' => [ 'local' => [ @@ -57,7 +55,6 @@ * Here you may configure the symbolic links that will be created when the * `storage:link` Artisan command is executed. The array keys should be * the locations of the links and the values should be their targets. - * */ 'links' => [ public_path('storage') => storage_path('app/public'), diff --git a/app/config/fractal.php b/app/config/fractal.php index 62329f7f..65aa34ad 100644 --- a/app/config/fractal.php +++ b/app/config/fractal.php @@ -40,4 +40,17 @@ */ 'request_key' => 'include', ], + + 'auto_excludes' => [ + /* + * If enabled Fractal will automatically add the excludes who's + * names are present in the `exclude` request parameter. + */ + 'enabled' => true, + + /* + * The name of key in the request to where we should look for the excludes to exclude. + */ + 'request_key' => 'exclude', + ], ]; diff --git a/app/config/hashing.php b/app/config/hashing.php deleted file mode 100644 index 1d93a4f0..00000000 --- a/app/config/hashing.php +++ /dev/null @@ -1,43 +0,0 @@ - 'bcrypt', - - /* - * Bcrypt Options - * - * Here you may specify the configuration options that should be used when - * passwords are hashed using the Bcrypt algorithm. This will allow you - * to control the amount of time it takes to hash the given password. - * - */ - 'bcrypt' => [ - 'rounds' => env('BCRYPT_ROUNDS', 10), - ], - - /* - * Argon Options - * - * Here you may specify the configuration options that should be used when - * passwords are hashed using the Argon algorithm. These will allow you - * to control the amount of time it takes to hash the given password. - * - */ - 'argon' => [ - 'memory' => 65536, - 'threads' => 1, - 'time' => 4, - ], -]; diff --git a/app/config/logging.php b/app/config/logging.php index 8d3be7b0..ceb744e9 100644 --- a/app/config/logging.php +++ b/app/config/logging.php @@ -28,7 +28,7 @@ */ 'deprecations' => [ 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), - 'trace' => false, + 'trace' => env('LOG_DEPRECATIONS_TRACE', false), ], /* @@ -46,7 +46,7 @@ 'channels' => [ 'stack' => [ 'driver' => 'stack', - 'channels' => ['single'], + 'channels' => explode(',', env('LOG_STACK', 'single')), 'ignore_exceptions' => false, ], @@ -68,8 +68,8 @@ 'slack' => [ 'driver' => 'slack', 'url' => env('LOG_SLACK_WEBHOOK_URL'), - 'username' => 'Laravel Log', - 'emoji' => ':boom:', + 'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'), + 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'), 'level' => env('LOG_LEVEL', 'critical'), 'replace_placeholders' => true, ], @@ -100,7 +100,7 @@ 'syslog' => [ 'driver' => 'syslog', 'level' => env('LOG_LEVEL', 'debug'), - 'facility' => LOG_USER, + 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER), 'replace_placeholders' => true, ], diff --git a/app/config/mail.php b/app/config/mail.php index 6cd202f6..998b63c5 100644 --- a/app/config/mail.php +++ b/app/config/mail.php @@ -6,12 +6,12 @@ /* * Default Mailer * - * This option controls the default mailer that is used to send any email - * messages sent by your application. Alternative mailers may be setup - * and used as needed; however, this mailer will be used by default. - * + * This option controls the default mailer that is used to send all email + * messages unless another mailer is explicitly specified when sending + * the message. All additional mailers can be configured within the + * "mailers" array. Examples of each type of mailer are provided. */ - 'default' => env('MAIL_MAILER', 'smtp'), + 'default' => env('MAIL_MAILER', 'log'), /* * Mailer Configurations @@ -20,19 +20,19 @@ * their respective settings. Several examples have been configured for * you, and you are free to add your own as your application requires. * - * Laravel supports a variety of mail "transport" drivers to be used while - * sending an e-mail. You will specify which one you are using for your - * mailers below. You are free to add additional mailers as required. - * - * Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", - * "postmark", "log", "array", "failover" + * Laravel supports a variety of mail "transport" drivers that can be used + * when delivering an email. You may specify which one you're using for + * your mailers below. You may also add additional mailers if needed. * + * Supported: "smtp", "sendmail", "ses", "ses-v2", + * "postmark", "log", "array", "failover", "roundrobin" */ 'mailers' => [ 'smtp' => [ 'transport' => 'smtp', - 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), - 'port' => env('MAIL_PORT', 587), + 'url' => env('MAIL_URL'), + 'host' => env('MAIL_HOST', '127.0.0.1'), + 'port' => env('MAIL_PORT', 2525), 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), @@ -44,15 +44,9 @@ 'transport' => 'ses', ], - 'mailgun' => [ - 'transport' => 'mailgun', - // 'client' => [ - // 'timeout' => 5, - // ], - ], - 'postmark' => [ 'transport' => 'postmark', + // 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'), // 'client' => [ // 'timeout' => 5, // ], @@ -79,6 +73,14 @@ 'log', ], ], + + 'roundrobin' => [ + 'transport' => 'roundrobin', + 'mailers' => [ + 'ses', + 'postmark', + ], + ], ], /* @@ -93,20 +95,4 @@ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 'name' => env('MAIL_FROM_NAME', 'Example'), ], - - /* - * Markdown Mail Settings - * - * If you are using Markdown based email rendering, you may configure your - * theme and component paths here, allowing you to customize the design - * of the emails. Or, you may simply stick with the Laravel defaults! - * - */ - 'markdown' => [ - 'theme' => 'default', - - 'paths' => [ - resource_path('views/vendor/mail'), - ], - ], ]; diff --git a/app/config/queue.php b/app/config/queue.php index f36a4838..b9c94fbe 100644 --- a/app/config/queue.php +++ b/app/config/queue.php @@ -11,7 +11,7 @@ * syntax for every one. Here you may define a default connection. * */ - 'default' => env('QUEUE_CONNECTION', 'sync'), + 'default' => env('QUEUE_CONNECTION', 'database'), /* * Queue Connections @@ -30,17 +30,18 @@ 'database' => [ 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', - 'retry_after' => 90, + 'connection' => env('DB_QUEUE_CONNECTION'), + 'table' => env('DB_QUEUE_TABLE', 'jobs'), + 'queue' => env('DB_QUEUE', 'default'), + 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90), 'after_commit' => false, ], 'beanstalkd' => [ 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'retry_after' => 90, + 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'), + 'queue' => env('BEANSTALKD_QUEUE', 'default'), + 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90), 'block_for' => 0, 'after_commit' => false, ], @@ -58,9 +59,9 @@ 'redis' => [ 'driver' => 'redis', - 'connection' => 'default', + 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), 'queue' => env('REDIS_QUEUE', 'default'), - 'retry_after' => 90, + 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90), 'block_for' => null, 'after_commit' => false, ], @@ -75,7 +76,7 @@ * */ 'batching' => [ - 'database' => env('DB_CONNECTION', 'mysql'), + 'database' => env('DB_CONNECTION', 'sqlite'), 'table' => 'job_batches', ], @@ -89,7 +90,7 @@ */ 'failed' => [ 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), - 'database' => env('DB_CONNECTION', 'mysql'), + 'database' => env('DB_CONNECTION', 'sqlite'), 'table' => 'failed_jobs', ], ]; diff --git a/app/config/sentry.php b/app/config/sentry.php index 21c610e2..fbf64c25 100644 --- a/app/config/sentry.php +++ b/app/config/sentry.php @@ -2,82 +2,125 @@ declare(strict_types=1); +/* + * Sentry Laravel SDK configuration file. + * + * @see https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/ + */ return [ + // @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/ 'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), + // @see https://spotlightjs.com/ + // 'spotlight' => env('SENTRY_SPOTLIGHT', false), + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#logger + // 'logger' => Sentry\Logger\DebugFileLogger::class, // By default this will log to `storage_path('logs/sentry.log')` + // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) 'release' => env('SENTRY_RELEASE'), - // When left empty or `null` the Laravel environment will be used + // When left empty or `null` the Laravel environment will be used (usually discovered from `APP_ENV` in your `.env`) 'environment' => env('SENTRY_ENVIRONMENT'), + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#sample-rate + 'sample_rate' => env('SENTRY_SAMPLE_RATE') === null ? 1.0 : (float) env('SENTRY_SAMPLE_RATE'), + + // @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'), + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#profiles-sample-rate + 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_PROFILES_SAMPLE_RATE'), + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii + 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore-exceptions + // 'ignore_exceptions' => [], + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore-transactions + 'ignore_transactions' => [ + // Ignore Laravel's default health URL + '/up', + ], + + // Breadcrumb specific configuration 'breadcrumbs' => [ - // Capture Laravel logs in breadcrumbs - 'logs' => true, + // Capture Laravel logs as breadcrumbs + 'logs' => env('SENTRY_BREADCRUMBS_LOGS_ENABLED', true), + + // Capture Laravel cache events (hits, writes etc.) as breadcrumbs + 'cache' => env('SENTRY_BREADCRUMBS_CACHE_ENABLED', true), - // Capture Laravel cache events in breadcrumbs - 'cache' => true, + // Capture Livewire components like routes as breadcrumbs + 'livewire' => env('SENTRY_BREADCRUMBS_LIVEWIRE_ENABLED', true), - // Capture Livewire components in breadcrumbs - 'livewire' => true, + // Capture SQL queries as breadcrumbs + 'sql_queries' => env('SENTRY_BREADCRUMBS_SQL_QUERIES_ENABLED', true), - // Capture SQL queries in breadcrumbs - 'sql_queries' => true, + // Capture SQL query bindings (parameters) in SQL query breadcrumbs + 'sql_bindings' => env('SENTRY_BREADCRUMBS_SQL_BINDINGS_ENABLED', false), - // Capture bindings on SQL queries logged in breadcrumbs - 'sql_bindings' => true, + // Capture queue job information as breadcrumbs + 'queue_info' => env('SENTRY_BREADCRUMBS_QUEUE_INFO_ENABLED', true), - // Capture queue job information in breadcrumbs - 'queue_info' => true, + // Capture command information as breadcrumbs + 'command_info' => env('SENTRY_BREADCRUMBS_COMMAND_JOBS_ENABLED', true), - // Capture command information in breadcrumbs - 'command_info' => true, + // Capture HTTP client request information as breadcrumbs + 'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS_ENABLED', true), - // Capture HTTP client requests information in breadcrumbs - 'http_client_requests' => true, + // Capture send notifications as breadcrumbs + 'notifications' => env('SENTRY_BREADCRUMBS_NOTIFICATIONS_ENABLED', true), ], + // Performance monitoring specific configuration 'tracing' => [ - // Trace queue jobs as their own transactions + // Trace queue jobs as their own transactions (this enables tracing for queue jobs) 'queue_job_transactions' => env('SENTRY_TRACE_QUEUE_ENABLED', false), // Capture queue jobs as spans when executed on the sync driver - 'queue_jobs' => true, + 'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS_ENABLED', true), // Capture SQL queries as spans - 'sql_queries' => true, + 'sql_queries' => env('SENTRY_TRACE_SQL_QUERIES_ENABLED', true), + + // Capture SQL query bindings (parameters) in SQL query spans + 'sql_bindings' => env('SENTRY_TRACE_SQL_BINDINGS_ENABLED', false), - // Try to find out where the SQL query originated from and add it to the query spans - 'sql_origin' => true, + // Capture where the SQL query originated from on the SQL query spans + 'sql_origin' => env('SENTRY_TRACE_SQL_ORIGIN_ENABLED', true), - // Capture views as spans - 'views' => true, + // Define a threshold in milliseconds for SQL queries to resolve their origin + 'sql_origin_threshold_ms' => env('SENTRY_TRACE_SQL_ORIGIN_THRESHOLD_MS', 100), + + // Capture views rendered as spans + 'views' => env('SENTRY_TRACE_VIEWS_ENABLED', true), // Capture Livewire components as spans - 'livewire' => true, + 'livewire' => env('SENTRY_TRACE_LIVEWIRE_ENABLED', true), // Capture HTTP client requests as spans - 'http_client_requests' => true, + 'http_client_requests' => env('SENTRY_TRACE_HTTP_CLIENT_REQUESTS_ENABLED', 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, + // Capture where the Redis command originated from on the Redis command spans + 'redis_origin' => env('SENTRY_TRACE_REDIS_ORIGIN_ENABLED', true), - // Indicates that requests without a matching route should be traced - 'missing_routes' => false, - ], + // Capture send notifications as spans + 'notifications' => env('SENTRY_TRACE_NOTIFICATIONS_ENABLED', true), - // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii - 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), + // Enable tracing for requests without a matching route (404's) + 'missing_routes' => env('SENTRY_TRACE_MISSING_ROUTES_ENABLED', 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'), + // Configures if the performance trace should continue after the response has been sent to the user until the application terminates + // This is required to capture any spans that are created after the response has been sent like queue jobs dispatched using `dispatch(...)->afterResponse()` for example + 'continue_after_response' => env('SENTRY_TRACE_CONTINUE_AFTER_RESPONSE', true), - 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_PROFILES_SAMPLE_RATE'), + // Enable the tracing integrations supplied by Sentry (recommended) + 'default_integrations' => env('SENTRY_TRACE_DEFAULT_INTEGRATIONS_ENABLED', true), + ], ]; diff --git a/app/config/services.php b/app/config/services.php index e5f2a8c0..75ddc85a 100644 --- a/app/config/services.php +++ b/app/config/services.php @@ -10,15 +10,7 @@ * as Mailgun, Postmark, AWS and more. This file provides the de facto * location for this type of information, allowing packages to have * 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', - ], - 'postmark' => [ 'token' => env('POSTMARK_TOKEN'), ], @@ -28,4 +20,11 @@ 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], + + 'slack' => [ + 'notifications' => [ + 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'), + 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'), + ], + ], ]; diff --git a/app/config/session.php b/app/config/session.php index 45975fb4..ac304506 100644 --- a/app/config/session.php +++ b/app/config/session.php @@ -8,13 +8,12 @@ /* * Default Session Driver * - * This option controls the default session "driver" that will be used on - * requests. By default, we will use the lightweight native driver but - * you may specify any of the other wonderful drivers provided here. + * This option determines the default session driver that is utilized for + * incoming requests. Laravel supports a variety of storage options to + * persist session data. Database storage is a great default choice. * * Supported: "file", "cookie", "database", "apc", * "memcached", "redis", "dynamodb", "array" - * */ 'driver' => env('SESSION_DRIVER', 'file'), @@ -23,29 +22,27 @@ * * Here you may specify the number of minutes that you wish the session * to be allowed to remain idle before it expires. If you want them - * to immediately expire on the browser closing, set that option. - * + * to expire immediately when the browser is closed then you may + * indicate that via the expire_on_close configuration option. */ 'lifetime' => env('SESSION_LIFETIME', 120), - 'expire_on_close' => false, + 'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false), /* * Session Encryption * * This option allows you to easily specify that all of your session data - * should be encrypted before it is stored. All encryption will be run - * automatically by Laravel and you can use the Session like normal. - * + * should be encrypted before it's stored. All encryption is performed + * automatically by Laravel and you may use the session like normal. */ - 'encrypt' => false, + 'encrypt' => env('SESSION_ENCRYPT', false), /* * Session File Location * - * When using the native session driver, we need a location where session - * files may be stored. A default has been set for you but a different - * location may be specified. This is only needed for file sessions. - * + * When utilizing the "file" session driver, the session files are placed + * on disk. The default storage location is defined here; however, you + * are free to provide another location where they should be stored. */ 'files' => storage_path('framework/sessions'), @@ -55,29 +52,26 @@ * When using the "database" or "redis" session drivers, you may specify a * connection that should be used to manage these sessions. This should * correspond to a connection in your database configuration options. - * */ 'connection' => env('SESSION_CONNECTION'), /* * Session Database Table * - * When using the "database" session driver, you may specify the table we - * should use to manage the sessions. Of course, a sensible default is - * provided for you; however, you are free to change this as needed. - * + * When using the "database" session driver, you may specify the table to + * be used to store sessions. Of course, a sensible default is defined + * for you; however, you're welcome to change this to another table. */ - 'table' => 'sessions', + 'table' => env('SESSION_TABLE', 'sessions'), /* * Session Cache Store * - * While using one of the framework's cache driven session backends you may - * 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" + * When using one of the framework's cache driven session backends, you may + * define the cache store which should be used to store the session data + * between requests. This must match one of your defined cache stores. * + * Affects: "dynamodb", "memcached", "redis" */ 'store' => env('SESSION_STORE'), @@ -87,17 +81,15 @@ * Some session drivers must manually sweep their storage location to get * rid of old sessions from storage. Here are the chances that it will * happen on a given request. By default, the odds are 2 out of 100. - * */ 'lottery' => [2, 100], /* * Session Cookie Name * - * Here you may change the name of the cookie used to identify a session - * instance by ID. The name specified here will get used every time a - * new session cookie is created by the framework for every driver. - * + * Here you may change the name of the session cookie that is created by + * the framework. Typically, you should not need to change this value + * since doing so does not grant a meaningful security improvement. */ 'cookie' => env( 'SESSION_COOKIE', @@ -109,18 +101,16 @@ * * The session cookie path determines the path for which the cookie will * be regarded as available. Typically, this will be the root path of - * your application, but you are free to change this when necessary. - * + * your application, but you're free to change this when necessary. */ - 'path' => '/', + 'path' => env('SESSION_PATH', '/'), /* * Session Cookie Domain * - * Here you may change the domain of the cookie used to identify a session - * in your application. This will determine which domains the cookie is - * available to in your application. A sensible default has been set. - * + * This value determines the domain and subdomains the session cookie is + * available to. By default, the cookie will be available to the root + * domain and all subdomains. Typically, this shouldn't be changed. */ 'domain' => env('SESSION_DOMAIN'), @@ -130,7 +120,6 @@ * 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 when it can't be done securely. - * */ 'secure' => env('SESSION_SECURE_COOKIE'), @@ -139,20 +128,29 @@ * * Setting this value to true will prevent JavaScript from accessing the * value of the cookie and the cookie will only be accessible through - * the HTTP protocol. You are free to modify this option if needed. - * + * the HTTP protocol. It's unlikely you should disable this option. */ - 'http_only' => true, + 'http_only' => env('SESSION_HTTP_ONLY', true), /* * Same-Site Cookies * * This option determines how your cookies behave when cross-site requests * take place, and can be used to mitigate CSRF attacks. By default, we - * will set this value to "lax" since this is a secure default value. + * will set this value to "lax" to permit secure cross-site requests. + * + * See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value * * Supported: "lax", "strict", "none", null + */ + 'same_site' => env('SESSION_SAME_SITE', 'lax'), + + /* + * Partitioned Cookies * + * Setting this value to true will tie the cookie to the top-level site for + * a cross-site context. Partitioned cookies are accepted by the browser + * when flagged "secure" and the Same-Site attribute is set to "none". */ - 'same_site' => 'lax', + 'partitioned' => env('SESSION_PARTITIONED_COOKIE', false), ]; diff --git a/app/config/view.php b/app/config/view.php deleted file mode 100644 index 796e1b4d..00000000 --- a/app/config/view.php +++ /dev/null @@ -1,30 +0,0 @@ - [ - resource_path('views'), - ], - - /* - * Compiled View Path - * - * This option determines where all the compiled Blade templates will be - * stored for your application. Typically, this is within the storage - * directory. However, as usual, you are free to change this value. - * - */ - 'compiled' => env( - 'VIEW_COMPILED_PATH', - realpath(storage_path('framework/views')) - ), -]; diff --git a/app/phpstan.neon.dist b/app/phpstan.neon.dist index 0d003c2c..d49f4e41 100644 --- a/app/phpstan.neon.dist +++ b/app/phpstan.neon.dist @@ -1,18 +1,12 @@ includes: - phpstan-baseline.neon - parameters: # The level 9 is the highest level level: 8 - paths: - src/ - tests/ - config/ - routes/ - - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false checkModelProperties: true - tmpDir: .build/phpstan/ diff --git a/app/phpunit.xml.dist b/app/phpunit.xml.dist index 65a342e3..882d493e 100644 --- a/app/phpunit.xml.dist +++ b/app/phpunit.xml.dist @@ -23,7 +23,7 @@ - + diff --git a/app/src/Bridge/Laravel/Admin/Category/Transformers/CategoryTransformer.php b/app/src/Bridge/Laravel/Admin/Category/Transformers/CategoryTransformer.php index 8737c1d5..9f58102f 100644 --- a/app/src/Bridge/Laravel/Admin/Category/Transformers/CategoryTransformer.php +++ b/app/src/Bridge/Laravel/Admin/Category/Transformers/CategoryTransformer.php @@ -9,6 +9,9 @@ final class CategoryTransformer extends TransformerAbstract { + /** + * @return array + */ public function transform(Category $category): array { return [