Skip to content

chore: update the Foundation to v12.4.1 #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/sync
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ transform([
line('Migrator::withoutMigrations([]);', 2) => PHP_EOL.line('if (class_exists(Migrator::class)) {
Migrator::withoutMigrations([]);
}'.PHP_EOL, 2),
line('Markdown::flushState();', 2) => PHP_EOL.line('if (class_exists(Markdown::class)) {
Markdown::flushState();
}'.PHP_EOL, 2),
line('Queue::createPayloadUsing(null);', 2) => PHP_EOL.line('if (class_exists(Queue::class)) {
Queue::createPayloadUsing(null);
}'.PHP_EOL, 2),
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": "^8.2"
},
"require-dev": {
"laravel/framework": "^11"
"laravel/framework": "^12"
},
"autoload": {
"files": [
Expand All @@ -22,7 +22,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "11.x-dev"
"dev-main": "12.x-dev"
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion config-stubs/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
|
*/

'timezone' => env('APP_TIMEZONE', 'UTC'),
'timezone' => 'UTC',

/*
|--------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
|
*/

'timezone' => env('APP_TIMEZONE', 'UTC'),
'timezone' => 'UTC',

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -130,7 +130,7 @@

'previous_keys' => [
...array_filter(
explode(',', env('APP_PREVIOUS_KEYS', ''))
explode(',', (string) env('APP_PREVIOUS_KEYS', ''))
),
],

Expand Down
2 changes: 1 addition & 1 deletion config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| Here you may define the number of seconds before a password confirmation
| window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
Expand Down
2 changes: 1 addition & 1 deletion config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@
|
*/

'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel'), '_').'_cache_'),

];
3 changes: 2 additions & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'prefix_indexes' => null,
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => null,
'journal_mode' => null,
Expand Down Expand Up @@ -147,7 +148,7 @@

'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel'), '_').'_database_'),
'persistent' => env('REDIS_PERSISTENT', false),
],

Expand Down
3 changes: 2 additions & 1 deletion config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'root' => storage_path('app/private'),
'serve' => true,
'throw' => false,
'report' => false,
],
Expand Down
1 change: 1 addition & 0 deletions config/hashing.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 12),
'verify' => env('HASH_VERIFY', true),
'limit' => env('BCRYPT_LIMIT', null),
],

/*
Expand Down
6 changes: 3 additions & 3 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

'stack' => [
'driver' => 'stack',
'channels' => explode(',', env('LOG_STACK', 'single')),
'channels' => explode(',', (string) env('LOG_STACK', 'single')),
'ignore_exceptions' => false,
],

Expand Down Expand Up @@ -98,10 +98,10 @@
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'handler_with' => [
'stream' => 'php://stderr',
],
'formatter' => env('LOG_STDERR_FORMATTER'),
'processors' => [PsrLogMessageProcessor::class],
],

Expand Down
4 changes: 3 additions & 1 deletion config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
],

'ses' => [
Expand Down Expand Up @@ -85,6 +85,7 @@
'smtp',
'log',
],
'retry_after' => 60,
],

'roundrobin' => [
Expand All @@ -93,6 +94,7 @@
'ses',
'postmark',
],
'retry_after' => 60,
],

],
Expand Down
8 changes: 4 additions & 4 deletions config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
| 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"
| Supported: "file", "cookie", "database", "memcached",
| "redis", "dynamodb", "array"
|
*/

Expand Down Expand Up @@ -97,7 +97,7 @@
| 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: "apc", "dynamodb", "memcached", "redis"
| Affects: "dynamodb", "memcached", "redis"
|
*/

Expand Down Expand Up @@ -129,7 +129,7 @@

'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
Str::slug((string) env('APP_NAME', 'laravel'), '_').'_session'
),

/*
Expand Down
3 changes: 1 addition & 2 deletions src/Illuminate/Foundation/AliasLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class AliasLoader
* Create a new AliasLoader instance.
*
* @param array $aliases
* @return void
*/
private function __construct($aliases)
{
Expand Down Expand Up @@ -164,7 +163,7 @@ public function register()
*/
protected function prependToLoaderStack()
{
spl_autoload_register([$this, 'load'], true, true);
spl_autoload_register($this->load(...), true, true);
}

/**
Expand Down
15 changes: 7 additions & 8 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
*
* @var string
*/
const VERSION = '11.44.2';
const VERSION = '12.17.0';

/**
* Copied from HttpKernelInterface, which this class no longer extends.
Expand Down Expand Up @@ -218,7 +218,6 @@ class Application extends Container implements ApplicationContract, CachesConfig
* Create a new Illuminate application instance.
*
* @param string|null $basePath
* @return void
*/
public function __construct($basePath = null)
{
Expand Down Expand Up @@ -430,14 +429,14 @@ protected function bindPathsInContainer()

$this->useBootstrapPath(value(function () {
return is_dir($directory = $this->basePath('.laravel'))
? $directory
: $this->basePath('bootstrap');
? $directory
: $this->basePath('bootstrap');
}));

$this->useLangPath(value(function () {
return is_dir($directory = $this->resourcePath('lang'))
? $directory
: $this->basePath('lang');
? $directory
: $this->basePath('lang');
}));
}

Expand Down Expand Up @@ -1375,8 +1374,8 @@ protected function normalizeCachePath($key, $default)
}

return Str::startsWith($env, $this->absoluteCachePathPrefixes)
? $env
: $this->basePath($env);
? $env
: $this->basePath($env);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function authorizeResource($model, $parameter = null, array $options = []
/**
* Get the map of resource methods to ability names.
*
* @return array
* @return array<string, string>
*/
protected function resourceAbilityMap()
{
Expand All @@ -126,7 +126,7 @@ protected function resourceAbilityMap()
/**
* Get the list of resource methods which do not have model parameters.
*
* @return array
* @return list<string>
*/
protected function resourceMethodsWithoutModels()
{
Expand Down
5 changes: 2 additions & 3 deletions src/Illuminate/Foundation/Bus/PendingChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class PendingChain
*
* @param mixed $job
* @param array $chain
* @return void
*/
public function __construct($job, $chain)
{
Expand Down Expand Up @@ -117,8 +116,8 @@ public function delay($delay)
public function catch($callback)
{
$this->catchCallbacks[] = $callback instanceof Closure
? new SerializableClosure($callback)
: $callback;
? new SerializableClosure($callback)
: $callback;

return $this;
}
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/Bus/PendingDispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class PendingDispatch
* Create a new pending job dispatch.
*
* @param mixed $job
* @return void
*/
public function __construct($job)
{
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/CacheBasedMaintenanceMode.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class CacheBasedMaintenanceMode implements MaintenanceMode
* @param \Illuminate\Contracts\Cache\Factory $cache
* @param string $store
* @param string $key
* @return void
*/
public function __construct(Factory $cache, string $store, string $key)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ public function withProviders(array $providers = [], bool $withBootstrapProvider
/**
* Register the core event service provider for the application.
*
* @param array|bool $discover
* @param iterable<int, string>|bool $discover
* @return $this
*/
public function withEvents(array|bool $discover = [])
public function withEvents(iterable|bool $discover = true)
{
if (is_array($discover) && count($discover) > 0) {
if (is_iterable($discover)) {
AppEventServiceProvider::setEventDiscoveryPaths($discover);
}

Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Foundation/Configuration/Exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class Exceptions
* Create a new exception handling configuration instance.
*
* @param \Illuminate\Foundation\Exceptions\Handler $handler
* @return void
*/
public function __construct(public Handler $handler)
{
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Foundation/Configuration/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ public function appendToPriorityList($after, $append)
public function getGlobalMiddleware()
{
$middleware = $this->global ?: array_values(array_filter([
\Illuminate\Http\Middleware\ValidatePathEncoding::class,
\Illuminate\Foundation\Http\Middleware\InvokeDeferredCallbacks::class,
$this->trustHosts ? \Illuminate\Http\Middleware\TrustHosts::class : null,
\Illuminate\Http\Middleware\TrustProxies::class,
Expand Down
25 changes: 23 additions & 2 deletions src/Illuminate/Foundation/Console/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class AboutCommand extends Command
* Create a new command instance.
*
* @param \Illuminate\Support\Composer $composer
* @return void
*/
public function __construct(Composer $composer)
{
Expand Down Expand Up @@ -165,6 +164,7 @@ protected function gatherApplicationInformation()

$formatEnabledStatus = fn ($value) => $value ? '<fg=yellow;options=bold>ENABLED</>' : 'OFF';
$formatCachedStatus = fn ($value) => $value ? '<fg=green;options=bold>CACHED</>' : '<fg=yellow;options=bold>NOT CACHED</>';
$formatStorageLinkedStatus = fn ($value) => $value ? '<fg=green;options=bold>LINKED</>' : '<fg=yellow;options=bold>NOT LINKED</>';

static::addToSection('Environment', fn () => [
'Application Name' => config('app.name'),
Expand All @@ -183,7 +183,7 @@ protected function gatherApplicationInformation()
'Config' => static::format($this->laravel->configurationIsCached(), console: $formatCachedStatus),
'Events' => static::format($this->laravel->eventsAreCached(), console: $formatCachedStatus),
'Routes' => static::format($this->laravel->routesAreCached(), console: $formatCachedStatus),
'Views' => static::format($this->hasPhpFiles($this->laravel->storagePath('framework/views')), console: $formatCachedStatus),
'Views' => static::format($this->hasPhpFiles(config('view.compiled')), console: $formatCachedStatus),
]);

static::addToSection('Drivers', fn () => array_filter([
Expand Down Expand Up @@ -214,9 +214,30 @@ protected function gatherApplicationInformation()
'Session' => config('session.driver'),
]));

static::addToSection('Storage', fn () => [
...$this->determineStoragePathLinkStatus($formatStorageLinkedStatus),
]);

(new Collection(static::$customDataResolvers))->each->__invoke();
}

/**
* Determine storage symbolic links status.
*
* @param callable $formatStorageLinkedStatus
* @return array<string,mixed>
*/
protected function determineStoragePathLinkStatus(callable $formatStorageLinkedStatus): array
{
return (new Collection(config('filesystems.links', [])))
->mapWithKeys(function ($target, $link) use ($formatStorageLinkedStatus) {
$path = Str::replace(public_path(), '', $link);

return [public_path($path) => static::format(file_exists($link), console: $formatStorageLinkedStatus)];
})
->toArray();
}

/**
* Determine whether the given directory has PHP files.
*
Expand Down
Loading