Skip to content

Commit

Permalink
feat: update laravel configs to 11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed May 28, 2024
1 parent 342a519 commit 7e9a599
Show file tree
Hide file tree
Showing 18 changed files with 286 additions and 341 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
65 changes: 22 additions & 43 deletions app/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),

Expand All @@ -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'),

Expand All @@ -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),

Expand All @@ -41,62 +38,46 @@
*
* 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'),

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

/*
Expand All @@ -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([
/*
Expand Down
38 changes: 17 additions & 21 deletions app/config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@
/*
* 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'),
],

/*
* Authentication Guards
*
* 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' => [
Expand All @@ -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' => [
Expand All @@ -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
Expand All @@ -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,
],
Expand All @@ -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),
];
22 changes: 8 additions & 14 deletions app/config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,30 +21,26 @@
* 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,
],

'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' => [
Expand All @@ -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' => [
Expand All @@ -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_'),
];
Loading

0 comments on commit 7e9a599

Please sign in to comment.