Switch local setup to PHP8.5 #64

Merged
jonny merged 1 commit from switch_to_php85 into develop 2025-12-14 13:59:54 +01:00
11 changed files with 77 additions and 26 deletions

View file

@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\Note; use App\Models\Note;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Response; use Illuminate\Http\Response;
@ -53,7 +52,7 @@ class NotesController extends Controller
->withCount(['webmentions AS reposts' => function ($query) { ->withCount(['webmentions AS reposts' => function ($query) {
$query->where('type', 'repost-of'); $query->where('type', 'repost-of');
}])->firstOrFail(); }])->firstOrFail();
} catch (ModelNotFoundException $exception) { } catch (\Exception) {
abort(404); abort(404);
} }

View file

@ -101,7 +101,7 @@ return [
'previous_keys' => [ 'previous_keys' => [
...array_filter( ...array_filter(
explode(',', env('APP_PREVIOUS_KEYS', '')) explode(',', (string) env('APP_PREVIOUS_KEYS', ''))
), ),
], ],

View file

@ -104,7 +104,7 @@ return [
| Password Confirmation Timeout | 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 | window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours. | confirmation screen. By default, the timeout lasts for three hours.
| |

View file

@ -26,8 +26,9 @@ return [
| well as their drivers. You may even define multiple stores for the | well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches. | 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" | "redis", "dynamodb", "octane",
| "failover", "null"
| |
*/ */
@ -89,6 +90,14 @@ return [
'driver' => 'octane', 'driver' => 'octane',
], ],
'failover' => [
'driver' => 'failover',
'stores' => [
'database',
'array',
],
],
], ],
/* /*
@ -102,6 +111,6 @@ return [
| |
*/ */
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'_cache_'),
]; ];

View file

@ -40,6 +40,7 @@ return [
'busy_timeout' => null, 'busy_timeout' => null,
'journal_mode' => null, 'journal_mode' => null,
'synchronous' => null, 'synchronous' => null,
'transaction_mode' => 'DEFERRED',
], ],
'mysql' => [ 'mysql' => [
@ -58,7 +59,7 @@ return [
'strict' => true, 'strict' => true,
'engine' => null, 'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([ 'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), (PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
]) : [], ]) : [],
], ],
@ -78,7 +79,7 @@ return [
'strict' => true, 'strict' => true,
'engine' => null, 'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([ 'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), (PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
]) : [], ]) : [],
], ],
@ -147,7 +148,7 @@ return [
'options' => [ 'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'), '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), 'persistent' => env('REDIS_PERSISTENT', false),
], ],
@ -158,6 +159,10 @@ return [
'password' => env('REDIS_PASSWORD'), 'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'), 'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'), 'database' => env('REDIS_DB', '0'),
'max_retries' => env('REDIS_MAX_RETRIES', 3),
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
], ],
'cache' => [ 'cache' => [
@ -167,6 +172,10 @@ return [
'password' => env('REDIS_PASSWORD'), 'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'), 'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'), 'database' => env('REDIS_CACHE_DB', '1'),
'max_retries' => env('REDIS_MAX_RETRIES', 3),
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
], ],
], ],

View file

@ -54,7 +54,7 @@ return [
'stack' => [ 'stack' => [
'driver' => 'stack', 'driver' => 'stack',
'channels' => explode(',', env('LOG_STACK', 'single')), 'channels' => explode(',', (string) env('LOG_STACK', 'single')),
'ignore_exceptions' => false, 'ignore_exceptions' => false,
], ],
@ -97,11 +97,10 @@ return [
'stderr' => [ 'stderr' => [
'driver' => 'monolog', 'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'), 'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class, 'handler_with' => [
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr', 'stream' => 'php://stderr',
], ],
'formatter' => env('LOG_STDERR_FORMATTER'),
'processors' => [PsrLogMessageProcessor::class], 'processors' => [PsrLogMessageProcessor::class],
], ],

View file

@ -30,7 +30,8 @@ return [
| your mailers below. You may also add additional mailers if needed. | your mailers below. You may also add additional mailers if needed.
| |
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "log", "array", "failover", "roundrobin" | "postmark", "resend", "log", "array",
| "failover", "roundrobin"
| |
*/ */
@ -45,7 +46,7 @@ return [
'username' => env('MAIL_USERNAME'), 'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'), 'password' => env('MAIL_PASSWORD'),
'timeout' => null, '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' => [ 'ses' => [
@ -60,6 +61,10 @@ return [
// ], // ],
], ],
'resend' => [
'transport' => 'resend',
],
'sendmail' => [ 'sendmail' => [
'transport' => 'sendmail', 'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
@ -80,6 +85,16 @@ return [
'smtp', 'smtp',
'log', 'log',
], ],
'retry_after' => 60,
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
'retry_after' => 60,
], ],
], ],

View file

@ -24,7 +24,8 @@ return [
| used by your application. An example configuration is provided for | used by your application. An example configuration is provided for
| each backend supported by Laravel. You're also free to add more. | each backend supported by Laravel. You're also free to add more.
| |
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" | Drivers: "sync", "database", "beanstalkd", "sqs", "redis",
| "deferred", "background", "failover", "null"
| |
*/ */
@ -72,6 +73,22 @@ return [
'after_commit' => false, 'after_commit' => false,
], ],
'deferred' => [
'driver' => 'deferred',
],
'background' => [
'driver' => 'background',
],
'failover' => [
'driver' => 'failover',
'connections' => [
'database',
'deferred',
],
],
], ],
/* /*

View file

@ -15,7 +15,11 @@ return [
*/ */
'postmark' => [ 'postmark' => [
'token' => env('POSTMARK_TOKEN'), 'key' => env('POSTMARK_API_KEY'),
],
'resend' => [
'key' => env('RESEND_API_KEY'),
], ],
'ses' => [ 'ses' => [

View file

@ -13,8 +13,8 @@ return [
| incoming requests. Laravel supports a variety of storage options to | incoming requests. Laravel supports a variety of storage options to
| persist session data. Database storage is a great default choice. | persist session data. Database storage is a great default choice.
| |
| Supported: "file", "cookie", "database", "apc", | Supported: "file", "cookie", "database", "memcached",
| "memcached", "redis", "dynamodb", "array" | "redis", "dynamodb", "array"
| |
*/ */
@ -97,7 +97,7 @@ return [
| define the cache store which should be used to store the session data | define the cache store which should be used to store the session data
| between requests. This must match one of your defined cache stores. | between requests. This must match one of your defined cache stores.
| |
| Affects: "apc", "dynamodb", "memcached", "redis" | Affects: "dynamodb", "memcached", "redis"
| |
*/ */
@ -125,12 +125,11 @@ return [
| the framework. Typically, you should not need to change this value | the framework. Typically, you should not need to change this value
| since doing so does not grant a meaningful security improvement. | since doing so does not grant a meaningful security improvement.
| |
|
*/ */
'cookie' => env( 'cookie' => env(
'SESSION_COOKIE', 'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session' Str::slug((string) env('APP_NAME', 'laravel')).'-session'
), ),
/* /*
@ -153,7 +152,7 @@ return [
| |
| This value determines the domain and subdomains the session cookie is | This value determines the domain and subdomains the session cookie is
| available to. By default, the cookie will be available to the root | available to. By default, the cookie will be available to the root
| domain and all subdomains. Typically, this shouldn't be changed. | domain without subdomains. Typically, this shouldn't be changed.
| |
*/ */

View file

@ -2,11 +2,11 @@
services: services:
laravel.test: laravel.test:
build: build:
context: ./vendor/laravel/sail/runtimes/8.4 context: ./vendor/laravel/sail/runtimes/8.5
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
WWWGROUP: '${WWWGROUP}' WWWGROUP: '${WWWGROUP}'
image: sail-8.4/app image: sail-8.5/app
extra_hosts: extra_hosts:
- 'host.docker.internal:host-gateway' - 'host.docker.internal:host-gateway'
ports: ports: