Upgrade to Laravel 11

This commit is contained in:
2024-03-12 16:30:26 +01:00
parent 8f4ab924a1
commit ac1112feb2
8 changed files with 521 additions and 528 deletions

View File

@ -1,25 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Console;
use App\Commands\RetrieveGitHubStats;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
#[\Override]
protected function schedule(Schedule $schedule): void
{
$schedule->command(RetrieveGitHubStats::class)
->everySixHours();
}
#[\Override]
protected function commands(): void
{
$this->load(__DIR__ . '/../Commands');
}
}

View File

@ -1,30 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
final class Kernel extends HttpKernel
{
protected $middleware = [
\Illuminate\Http\Middleware\TrustProxies::class,
\Illuminate\Http\Middleware\HandleCors::class,
\Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\Illuminate\Foundation\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
protected $middlewareGroups = [
'web' => [\Illuminate\Routing\Middleware\SubstituteBindings::class],
];
protected $middlewareAliases = [
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
}

7
app/console.php Normal file
View File

@ -0,0 +1,7 @@
<?php
declare(strict_types=1);
use Illuminate\Support\Facades\Schedule;
Schedule::call('github:fetch')->everySixHours();

View File

@ -2,12 +2,17 @@
declare(strict_types=1);
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
$app->singleton(Illuminate\Contracts\Http\Kernel::class, App\Http\Kernel::class);
$app->singleton(Illuminate\Contracts\Console\Kernel::class, App\Console\Kernel::class);
$app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, Illuminate\Foundation\Exceptions\Handler::class);
return $app;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__ . '/../app/routes.php',
commands: __DIR__ . '/../app/console.php',
health: '/up'
)
->withCommands([__DIR__ . '/../app/Commands'])
->withMiddleware(function (Middleware $middleware) {})
->withExceptions(function (Exceptions $exceptions) {})
->create();

7
bootstrap/providers.php Normal file
View File

@ -0,0 +1,7 @@
<?php
declare(strict_types=1);
return [
App\Providers\RouteServiceProvider::class,
];

View File

@ -6,7 +6,7 @@
"require": {
"php": "^8.3",
"guzzlehttp/guzzle": "^7.8.1",
"laravel/framework": "^10.43",
"laravel/framework": "^11",
"laravel/tinker": "^2.9.0",
"league/commonmark": "^2.4.2"
},
@ -16,7 +16,7 @@
"laravel/pint": "^1.13.10",
"laravel/sail": "^1.27.3",
"mockery/mockery": "^1.6.7",
"nunomaduro/collision": "^7.10",
"nunomaduro/collision": "^8.1",
"phpunit/phpunit": "^10.0",
"rector/rector": "^1.0",
"spatie/laravel-ignition": "^2.4.2"

909
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -145,52 +145,6 @@
// 'store' => 'redis',
],
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| 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' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Application Service Providers...
*/
App\Providers\RouteServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases