diff --git a/CHANGELOG.md b/CHANGELOG.md index 2177ed1..1e705a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- **BREAKING**: Don't merge merge framework configuration. ## [0.27.0] - 2024-05-31 diff --git a/src/Foundation/Application.php b/src/Foundation/Application.php index a0b8604..238cd5d 100644 --- a/src/Foundation/Application.php +++ b/src/Foundation/Application.php @@ -23,7 +23,9 @@ public static function configure(?string $basePath = null) default => static::inferBasePath(), }; - $app = (new static($basePath))->useConfigPath(realpath(__DIR__ . '/../config')); + $app = (new static($basePath)) + ->useConfigPath(realpath(__DIR__ . '/../config')) + ->dontMergeFrameworkConfiguration(); $routeFile = fn (string $path) => file_exists($path) ? $path : null; diff --git a/src/config/app.php b/src/config/app.php index 63bc782..0ad24ab 100644 --- a/src/config/app.php +++ b/src/config/app.php @@ -1,5 +1,8 @@ env('APP_URL', 'http://localhost'), + 'frontend_url' => env('FRONTEND_URL', 'http://localhost:3000'), + + 'asset_url' => env('ASSET_URL'), + /* |-------------------------------------------------------------------------- | Application Timezone @@ -80,8 +87,30 @@ 'locale' => env('APP_LOCALE', 'en'), + /* + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the default one + | is not available. You may change the value to correspond to any of + | the languages which are currently supported by your application. + | + */ + 'fallback_locale' => env('APP_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' => env('APP_FAKER_LOCALE', 'en_US'), /* @@ -123,4 +152,30 @@ 'store' => env('APP_MAINTENANCE_STORE', 'database'), ], + /* + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on any + | requests to your application. You may add your own services to the + | arrays below to provide additional features to this application. + | + */ + + 'providers' => ServiceProvider::defaultProviders()->toArray(), + + /* + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. You may add any additional class aliases which should + | be loaded to the array. For speed, all aliases are lazy loaded. + | + */ + + 'aliases' => Facade::defaultAliases()->toArray(), + ]; diff --git a/src/config/broadcasting.php b/src/config/broadcasting.php new file mode 100644 index 0000000..7ad8011 --- /dev/null +++ b/src/config/broadcasting.php @@ -0,0 +1,82 @@ + env('BROADCAST_CONNECTION', 'null'), + + /* + |-------------------------------------------------------------------------- + | Broadcast Connections + |-------------------------------------------------------------------------- + | + | Here you may define all of the broadcast connections that will be used + | to broadcast events to other systems or over WebSockets. Samples of + | each available type of connection are provided inside this array. + | + */ + + 'connections' => [ + + 'reverb' => [ + 'driver' => 'reverb', + 'key' => env('REVERB_APP_KEY'), + 'secret' => env('REVERB_APP_SECRET'), + 'app_id' => env('REVERB_APP_ID'), + 'options' => [ + 'host' => env('REVERB_HOST'), + 'port' => env('REVERB_PORT', 443), + 'scheme' => env('REVERB_SCHEME', 'https'), + 'useTLS' => env('REVERB_SCHEME', 'https') === 'https', + ], + 'client_options' => [ + // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html + ], + ], + + 'pusher' => [ + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + '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' => [ + 'driver' => 'ably', + 'key' => env('ABLY_KEY'), + ], + + 'log' => [ + 'driver' => 'log', + ], + + 'null' => [ + 'driver' => 'null', + ], + + ], + +]; diff --git a/src/config/cache.php b/src/config/cache.php index 1b7359c..59d8e16 100644 --- a/src/config/cache.php +++ b/src/config/cache.php @@ -26,7 +26,7 @@ | 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", "memcached", + | Supported drivers: "array", "database", "file", "memcached", | "redis", "dynamodb", "octane", "null" | */ diff --git a/src/config/cors.php b/src/config/cors.php new file mode 100644 index 0000000..8a39e6d --- /dev/null +++ b/src/config/cors.php @@ -0,0 +1,34 @@ + ['api/*', 'sanctum/csrf-cookie'], + + 'allowed_methods' => ['*'], + + 'allowed_origins' => ['*'], + + 'allowed_origins_patterns' => [], + + 'allowed_headers' => ['*'], + + 'exposed_headers' => [], + + 'max_age' => 0, + + 'supports_credentials' => false, + +]; diff --git a/src/config/database.php b/src/config/database.php index 5935b41..30a3978 100644 --- a/src/config/database.php +++ b/src/config/database.php @@ -34,14 +34,14 @@ 'default' => [ 'driver' => env('DB_DRIVER', 'mysql'), 'url' => env('DB_URL'), - 'host' => explode(',', env('DB_HOST', '127.0.0.1')), + 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => sqlite_database_path(env('DB_DATABASE'), env('DB_DRIVER')), 'username' => env('DB_USERNAME', 'username'), 'password' => env('DB_PASSWORD', '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, diff --git a/src/config/filesystems.php b/src/config/filesystems.php index 40b7e78..8009a25 100644 --- a/src/config/filesystems.php +++ b/src/config/filesystems.php @@ -24,7 +24,7 @@ | 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" + | Supported drivers: "local", "ftp", "sftp", "s3" | */ diff --git a/src/config/hashing.php b/src/config/hashing.php new file mode 100644 index 0000000..9eb408e --- /dev/null +++ b/src/config/hashing.php @@ -0,0 +1,67 @@ + env('HASH_DRIVER', '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', 12), + 'verify' => env('HASH_VERIFY', true), + ], + + /* + |-------------------------------------------------------------------------- + | 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' => env('ARGON_MEMORY', 65536), + 'threads' => env('ARGON_THREADS', 1), + 'time' => env('ARGON_TIME', 4), + 'verify' => env('HASH_VERIFY', true), + ], + + /* + |-------------------------------------------------------------------------- + | Rehash On Login + |-------------------------------------------------------------------------- + | + | Setting this option to true will tell Laravel to automatically rehash + | the user's password during login if the configured work factor for + | the algorithm has changed, allowing graceful upgrades of hashes. + | + */ + + 'rehash_on_login' => true, + +]; diff --git a/src/config/logging.php b/src/config/logging.php index 5a5b0f9..438b9f9 100644 --- a/src/config/logging.php +++ b/src/config/logging.php @@ -3,6 +3,7 @@ use Butler\Service\Logging\GraylogLoggerFactory; use Monolog\Handler\NullHandler; use Monolog\Handler\StreamHandler; +use Monolog\Handler\SyslogUdpHandler; use Monolog\Processor\PsrLogMessageProcessor; return [ @@ -45,7 +46,7 @@ | utilizes the Monolog PHP logging library, which includes a variety | of powerful log handlers and formatters that you're free to use. | - | Available Drivers: "single", "daily", "slack", "syslog", + | Available drivers: "single", "daily", "slack", "syslog", | "errorlog", "monolog", "custom", "stack" | */ @@ -55,7 +56,7 @@ 'stack' => [ 'driver' => 'stack', 'channels' => array_filter([ - 'daily', + ...explode(',', env('LOG_STACK', 'daily')), env('BUGSNAG_API_KEY') ? 'bugsnag' : null, env('GRAYLOG_HOST') ? 'graylog' : null, ]), @@ -86,6 +87,18 @@ 'replace_placeholders' => true, ], + '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'), + ], + 'processors' => [PsrLogMessageProcessor::class], + ], + 'stderr' => [ 'driver' => 'monolog', 'level' => env('LOG_LEVEL', 'debug'), diff --git a/src/config/mail.php b/src/config/mail.php index 634ee8a..4a6b02c 100644 --- a/src/config/mail.php +++ b/src/config/mail.php @@ -30,7 +30,8 @@ | your mailers below. You may also add additional mailers if needed. | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", - | "postmark", "log", "array", "failover", "roundrobin" + | "postmark", "resend", "log", "array", + | "failover", "roundrobin" | */ @@ -45,7 +46,7 @@ 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'timeout' => null, - 'local_domain' => env('MAIL_EHLO_DOMAIN'), + 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)), ], 'ses' => [ @@ -60,6 +61,10 @@ // ], ], + 'resend' => [ + 'transport' => 'resend', + ], + 'sendmail' => [ 'transport' => 'sendmail', 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), @@ -82,6 +87,14 @@ ], ], + 'roundrobin' => [ + 'transport' => 'roundrobin', + 'mailers' => [ + 'ses', + 'postmark', + ], + ], + ], /* @@ -112,11 +125,10 @@ */ 'markdown' => [ - 'theme' => 'default', + 'theme' => env('MAIL_MARKDOWN_THEME', 'default'), 'paths' => [ resource_path('views/vendor/mail'), ], ], - ]; diff --git a/src/config/queue.php b/src/config/queue.php index 07d86f6..30d70a8 100644 --- a/src/config/queue.php +++ b/src/config/queue.php @@ -36,10 +36,10 @@ 'database' => [ 'driver' => 'database', - 'connection' => env('DB_QUEUE_CONNECTION', null), + 'connection' => env('DB_QUEUE_CONNECTION'), 'table' => env('DB_QUEUE_TABLE', 'jobs'), 'queue' => env('DB_QUEUE', 'default'), - 'retry_after' => env('DB_QUEUE_RETRY_AFTER', 90), + 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90), 'after_commit' => false, ], @@ -47,7 +47,7 @@ 'driver' => 'beanstalkd', 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'), 'queue' => env('BEANSTALKD_QUEUE', 'default'), - 'retry_after' => env('BEANSTALKD_QUEUE_RETRY_AFTER', 90), + 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90), 'block_for' => 0, 'after_commit' => false, ], @@ -67,7 +67,7 @@ 'driver' => 'redis', 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), 'queue' => env('REDIS_QUEUE', 'default'), - 'retry_after' => env('REDIS_QUEUE_RETRY_AFTER', 90), + 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90), 'block_for' => null, 'after_commit' => false, ], diff --git a/src/config/view.php b/src/config/view.php new file mode 100644 index 0000000..22b8a18 --- /dev/null +++ b/src/config/view.php @@ -0,0 +1,36 @@ + [ + 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')) + ), + +];