Skip to content

Commit c89c993

Browse files
committed
feat: add support for Laravel 12
1 parent 111d28d commit c89c993

File tree

7 files changed

+47
-60
lines changed

7 files changed

+47
-60
lines changed

composer.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@
2121
"require": {
2222
"php": "^8.2",
2323
"ext-json": "*",
24-
"dragonmantank/cron-expression": "^3.4.0",
24+
"dragonmantank/cron-expression": "^3.4",
2525
"guzzlehttp/guzzle": "^7.9.2",
26-
"illuminate/cache": "^11.30.0",
27-
"illuminate/collections": "^11.30.0",
28-
"illuminate/config": "^11.30.0",
29-
"illuminate/console": "^11.30.0",
30-
"illuminate/container": "^11.30.0",
31-
"illuminate/contracts": "^11.30.0",
32-
"illuminate/events": "^11.30.0",
33-
"illuminate/filesystem": "^11.30.0",
34-
"illuminate/process": "^11.30.0",
35-
"illuminate/support": "^11.30.0",
36-
"illuminate/testing": "^11.30.0",
37-
"laravel-zero/foundation": "^11.5.0",
26+
"illuminate/cache": "^12.4",
27+
"illuminate/collections": "^12.4",
28+
"illuminate/config": "^12.4",
29+
"illuminate/console": "^12.4",
30+
"illuminate/container": "^12.4",
31+
"illuminate/contracts": "^12.4",
32+
"illuminate/events": "^12.4",
33+
"illuminate/filesystem": "^12.4",
34+
"illuminate/process": "^12.4",
35+
"illuminate/support": "^12.4",
36+
"illuminate/testing": "^12.4",
37+
"laravel-zero/foundation": "dev-feature/laravel-12",
3838
"laravel/prompts": "^0.3.1",
3939
"league/flysystem": "^3.29.1",
4040
"nunomaduro/collision": "^8.5.0",
@@ -44,28 +44,28 @@
4444
"nunomaduro/termwind": "^2.2.0",
4545
"psr/log": "^3.0.2",
4646
"ramsey/uuid": "^4.7.6",
47-
"symfony/console": "^7.1.6",
48-
"symfony/error-handler": "^7.1.6",
49-
"symfony/event-dispatcher": "^7.1.6",
50-
"symfony/finder": "^7.1.6",
51-
"symfony/process": "^7.1.6",
52-
"symfony/var-dumper": "^7.1.6",
47+
"symfony/console": "^7.2",
48+
"symfony/error-handler": "^7.2",
49+
"symfony/event-dispatcher": "^7.2",
50+
"symfony/finder": "^7.2",
51+
"symfony/process": "^7.2",
52+
"symfony/var-dumper": "^7.2",
5353
"vlucas/phpdotenv": "^5.6.1"
5454
},
5555
"require-dev": {
56-
"illuminate/bus": "^11.30.0",
57-
"illuminate/database": "^11.30.0",
58-
"illuminate/http": "^11.30.0",
59-
"illuminate/log": "^11.30.0",
60-
"illuminate/queue": "^11.30.0",
61-
"illuminate/redis": "^11.30.0",
62-
"illuminate/view": "^11.30.0",
63-
"laravel-zero/phar-updater": "^1.4",
64-
"laravel/pint": "^1.18.1",
65-
"nunomaduro/laravel-console-dusk": "^1.13.1",
66-
"nunomaduro/laravel-console-menu": "^3.5",
67-
"pestphp/pest": "^3.5.1",
68-
"phpstan/phpstan": "^1.12.7"
56+
"illuminate/bus": "^12.4",
57+
"illuminate/database": "^12.4",
58+
"illuminate/http": "^12.4",
59+
"illuminate/log": "^12.4",
60+
"illuminate/queue": "^12.4",
61+
"illuminate/redis": "^12.4",
62+
"illuminate/view": "^12.4",
63+
"laravel-zero/phar-updater": "^1.4.1",
64+
"laravel/pint": "^1.21",
65+
"nunomaduro/laravel-console-dusk": "^1.14",
66+
"nunomaduro/laravel-console-menu": "^3.6",
67+
"pestphp/pest": "^3.8",
68+
"phpstan/phpstan": "^2.1"
6969
},
7070
"autoload": {
7171
"psr-4": {

src/Application.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public function registerConfiguredProviders(): void
127127
$providers->splice(
128128
1,
129129
0,
130+
// @phpstan-ignore argument.type
130131
[
131132
$this->make(PackageManifest::class)
132133
->providers(),

src/Commands/BuildCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getSubscribedSignals(): array
8282
}
8383

8484
/** {@inheritdoc} */
85-
public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false
85+
public function handleSignal(int $signal, int|false $previousExitCode = 0): int
8686
{
8787
if (defined('SIGINT') && $signal === \SIGINT) {
8888
if (self::$config !== null) {

src/Commands/InstallCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function handle()
6060
$option = $this->choice($title, $choices);
6161
}
6262

63+
// @phpstan-ignore notIdentical.alwaysTrue
6364
if ($option !== null && ! empty($this->componentInstallers[$option])) {
6465
/** @var AbstractInstaller $command */
6566
$command = $this->app[$this->componentInstallers[$option]];

src/Providers/Filesystem/FilesystemServiceProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,10 @@ protected function getDefaultConfig(): array
5454
],
5555
];
5656
}
57+
58+
/** Laravel Zero doesn't support serving files. */
59+
protected function shouldServeFiles(array $config)
60+
{
61+
return false;
62+
}
5763
}

tests/Application/bootstrap/app.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
<?php
22

3-
$app = new LaravelZero\Framework\Application(
4-
realpath(dirname(__DIR__))
5-
);
3+
use LaravelZero\Framework\Application;
64

7-
$app->singleton(
8-
Illuminate\Contracts\Console\Kernel::class,
9-
LaravelZero\Framework\Kernel::class
10-
);
11-
12-
$app->singleton(
13-
Illuminate\Contracts\Debug\ExceptionHandler::class,
14-
Illuminate\Foundation\Exceptions\Handler::class
15-
);
16-
17-
return $app;
5+
return Application::configure(basePath: dirname(__DIR__))->create();

tests/TestCase.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,34 @@
44

55
namespace Tests;
66

7+
use Illuminate\Contracts\Console\Kernel;
78
use Illuminate\Contracts\Foundation\Application as ApplicationContract;
8-
use LaravelZero\Framework\Application;
99
use LaravelZero\Framework\Testing\TestCase as BaseTestCase;
1010

1111
abstract class TestCase extends BaseTestCase
1212
{
1313
/**
1414
* The application instance.
1515
*
16-
* @var \Illuminate\Contracts\Foundation\Application
16+
* @var ApplicationContract
1717
*/
1818
protected $app;
1919

20-
/**
21-
* {@inheritdoc}
22-
*/
20+
/** {@inheritdoc} */
2321
protected function setUp(): void
2422
{
2523
if (! defined('ARTISAN_BINARY')) {
2624
define('ARTISAN_BINARY', 'application');
2725
}
2826

2927
parent::setUp();
30-
31-
$this->app = $this->createApplication();
3228
}
3329

34-
/**
35-
* Creates a new instance of the application.
36-
*/
3730
public function createApplication(): ApplicationContract
3831
{
3932
$app = require __DIR__.'/Application/bootstrap/app.php';
4033

41-
Application::setInstance($app);
42-
43-
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
34+
$app->make(Kernel::class)->bootstrap();
4435

4536
return $app;
4637
}

0 commit comments

Comments
 (0)