Skip to content

Commit

Permalink
Dont merge framework config
Browse files Browse the repository at this point in the history
  • Loading branch information
ttrig committed Aug 2, 2024
1 parent 204eb20 commit 3fc68d1
Show file tree
Hide file tree
Showing 13 changed files with 319 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion src/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
55 changes: 55 additions & 0 deletions src/config/app.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;

return [

/*
Expand Down Expand Up @@ -54,6 +57,10 @@

'url' => env('APP_URL', 'http://localhost'),

'frontend_url' => env('FRONTEND_URL', 'http://localhost:3000'),

'asset_url' => env('ASSET_URL'),

/*
|--------------------------------------------------------------------------
| Application Timezone
Expand All @@ -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'),

/*
Expand Down Expand Up @@ -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(),

];
82 changes: 82 additions & 0 deletions src/config/broadcasting.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "reverb", "pusher", "ably", "redis", "log", "null"
|
*/

'default' => 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',
],

],

];
2 changes: 1 addition & 1 deletion src/config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"
|
*/
Expand Down
34 changes: 34 additions & 0 deletions src/config/cors.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/

'paths' => ['api/*', 'sanctum/csrf-cookie'],

'allowed_methods' => ['*'],

'allowed_origins' => ['*'],

'allowed_origins_patterns' => [],

'allowed_headers' => ['*'],

'exposed_headers' => [],

'max_age' => 0,

'supports_credentials' => false,

];
6 changes: 3 additions & 3 deletions src/config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"
|
*/

Expand Down
67 changes: 67 additions & 0 deletions src/config/hashing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/

'driver' => 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,

];
17 changes: 15 additions & 2 deletions src/config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down Expand Up @@ -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"
|
*/
Expand All @@ -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,
]),
Expand Down Expand Up @@ -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'),
Expand Down
Loading

0 comments on commit 3fc68d1

Please sign in to comment.