Skip to content

Commit 84cab17

Browse files
committed
Revert "⬆️ Laravel v12 (#436)"
This reverts commit dcb5823.
1 parent dcb5823 commit 84cab17

25 files changed

+142
-354
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<p align="center">
88
<a href="https://packagist.org/packages/roots/acorn"><img alt="Packagist Downloads" src="https://img.shields.io/packagist/dt/roots/acorn?label=downloads&colorB=2b3072&colorA=525ddc&style=flat-square"></a>
9-
<a href="https://laravel.com/docs/12.x"><img alt="Laravel v12" src="https://img.shields.io/static/v1?label=laravel&message=v12&logo=Laravel&style=flat-square&color=f9322c"></a>
9+
<a href="https://laravel.com/docs/11.x"><img alt="Laravel v11" src="https://img.shields.io/static/v1?label=laravel&message=v11&logo=Laravel&style=flat-square&color=f9322c"></a>
1010
<a href="https://github.com/roots/acorn/actions/workflows/main.yml"><img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/roots/acorn/main.yml?branch=main&logo=github&label=CI&style=flat-square"></a>
1111
<a href="https://bsky.app/profile/roots.dev"><img alt="Follow roots.dev on Bluesky" src="https://img.shields.io/badge/follow-@roots.dev-0085ff?logo=bluesky&style=flat-square"></a>
1212
</p>

composer.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,26 @@
4747
"ext-mbstring": "*",
4848
"dragonmantank/cron-expression": "^3.4",
4949
"guzzlehttp/guzzle": "^7.8",
50-
"illuminate/cache": "^12.0",
51-
"illuminate/config": "^12.0",
52-
"illuminate/console": "^12.0",
53-
"illuminate/container": "^12.0",
54-
"illuminate/contracts": "^12.0",
55-
"illuminate/cookie": "^12.0",
56-
"illuminate/database": "^12.0",
57-
"illuminate/encryption": "^12.0",
58-
"illuminate/events": "^12.0",
59-
"illuminate/filesystem": "^12.0",
60-
"illuminate/hashing": "^12.0",
61-
"illuminate/http": "^12.0",
62-
"illuminate/log": "^12.0",
63-
"illuminate/queue": "^12.0",
64-
"illuminate/routing": "^12.0",
65-
"illuminate/support": "^12.0",
66-
"illuminate/testing": "^12.0",
67-
"illuminate/validation": "^12.0",
68-
"illuminate/view": "^12.0",
69-
"laravel/prompts": "^0.3.0",
50+
"illuminate/cache": "^11.0",
51+
"illuminate/config": "^11.0",
52+
"illuminate/console": "^11.0",
53+
"illuminate/container": "^11.0",
54+
"illuminate/contracts": "^11.0",
55+
"illuminate/cookie": "^11.0",
56+
"illuminate/database": "^11.0",
57+
"illuminate/encryption": "^11.0",
58+
"illuminate/events": "^11.0",
59+
"illuminate/filesystem": "^11.0",
60+
"illuminate/hashing": "^11.0",
61+
"illuminate/http": "^11.0",
62+
"illuminate/log": "^11.0",
63+
"illuminate/queue": "^11.0",
64+
"illuminate/routing": "^11.0",
65+
"illuminate/support": "^11.0",
66+
"illuminate/testing": "^11.0",
67+
"illuminate/validation": "^11.0",
68+
"illuminate/view": "^11.0",
69+
"laravel/prompts": "^0.1.17",
7070
"laravel/serializable-closure": "^1.3",
7171
"league/flysystem": "^3.26",
7272
"ramsey/uuid": "^4.7",

src/Illuminate/Foundation/AliasLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function register()
164164
*/
165165
protected function prependToLoaderStack()
166166
{
167-
spl_autoload_register($this->load(...), true, true);
167+
spl_autoload_register([$this, 'load'], true, true);
168168
}
169169

170170
/**

src/Illuminate/Foundation/Application.php

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
4545
*
4646
* @var string
4747
*/
48-
const VERSION = '12.0.1';
48+
const VERSION = '11.40.0';
4949

5050
/**
5151
* The base path for the Laravel installation.
@@ -223,7 +223,6 @@ public function __construct($basePath = null)
223223
$this->registerBaseBindings();
224224
$this->registerBaseServiceProviders();
225225
$this->registerCoreContainerAliases();
226-
$this->registerLaravelCloudServices();
227226
}
228227

229228
/**
@@ -304,28 +303,6 @@ protected function registerBaseServiceProviders()
304303
$this->register(new RoutingServiceProvider($this));
305304
}
306305

307-
/**
308-
* Register any services needed for Laravel Cloud.
309-
*
310-
* @return void
311-
*/
312-
protected function registerLaravelCloudServices()
313-
{
314-
if (! laravel_cloud()) {
315-
return;
316-
}
317-
318-
$this['events']->listen(
319-
'bootstrapping: *',
320-
fn ($bootstrapper) => Cloud::bootstrapperBootstrapping($this, Str::after($bootstrapper, 'bootstrapping: '))
321-
);
322-
323-
$this['events']->listen(
324-
'bootstrapped: *',
325-
fn ($bootstrapper) => Cloud::bootstrapperBootstrapped($this, Str::after($bootstrapper, 'bootstrapped: '))
326-
);
327-
}
328-
329306
/**
330307
* Run the given array of bootstrap classes.
331308
*
@@ -1043,11 +1020,9 @@ public function registerDeferredProvider($provider, $service = null)
10431020
/**
10441021
* Resolve the given type from the container.
10451022
*
1046-
* @template TClass of object
1047-
*
1048-
* @param string|class-string<TClass> $abstract
1023+
* @param string $abstract
10491024
* @param array $parameters
1050-
* @return ($abstract is class-string<TClass> ? TClass : mixed)
1025+
* @return mixed
10511026
*
10521027
* @throws \Illuminate\Contracts\Container\BindingResolutionException
10531028
*/
@@ -1061,12 +1036,10 @@ public function make($abstract, array $parameters = [])
10611036
/**
10621037
* Resolve the given type from the container.
10631038
*
1064-
* @template TClass of object
1065-
*
1066-
* @param string|class-string<TClass>|callable $abstract
1039+
* @param string $abstract
10671040
* @param array $parameters
10681041
* @param bool $raiseEvents
1069-
* @return ($abstract is class-string<TClass> ? TClass : mixed)
1042+
* @return mixed
10701043
*
10711044
* @throws \Illuminate\Contracts\Container\BindingResolutionException
10721045
* @throws \Illuminate\Contracts\Container\CircularDependencyException

src/Illuminate/Foundation/Bootstrap/HandleExceptions.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
use Illuminate\Contracts\Foundation\Application;
99
use Illuminate\Log\LogManager;
1010
use Illuminate\Support\Env;
11+
use Monolog\Formatter\JsonFormatter;
1112
use Monolog\Handler\NullHandler;
13+
use Monolog\Handler\SocketHandler;
1214
use PHPUnit\Runner\ErrorHandler;
1315
use Symfony\Component\Console\Output\ConsoleOutput;
1416
use Symfony\Component\ErrorHandler\Error\FatalError;
@@ -53,6 +55,10 @@ public function bootstrap(Application $app)
5355
if (! $app->environment('testing')) {
5456
ini_set('display_errors', 'Off');
5557
}
58+
59+
if (laravel_cloud()) {
60+
$this->configureCloudLogging($app);
61+
}
5662
}
5763

5864
/**
@@ -245,6 +251,34 @@ protected function fatalErrorFromPhpError(array $error, $traceOffset = null)
245251
return new FatalError($error['message'], 0, $error, $traceOffset);
246252
}
247253

254+
/**
255+
* Configure the Laravel Cloud log channels.
256+
*
257+
* @param \Illuminate\Contracts\Foundation\Application $app
258+
* @return void
259+
*/
260+
protected function configureCloudLogging(Application $app)
261+
{
262+
$app['config']->set('logging.channels.stderr.formatter_with', [
263+
'includeStacktraces' => true,
264+
]);
265+
266+
$app['config']->set('logging.channels.laravel-cloud-socket', [
267+
'driver' => 'monolog',
268+
'handler' => SocketHandler::class,
269+
'formatter' => JsonFormatter::class,
270+
'formatter_with' => [
271+
'includeStacktraces' => true,
272+
],
273+
'with' => [
274+
'connectionString' => $_ENV['LARAVEL_CLOUD_LOG_SOCKET'] ??
275+
$_SERVER['LARAVEL_CLOUD_LOG_SOCKET'] ??
276+
'unix:///tmp/cloud-init.sock',
277+
'persistent' => true,
278+
],
279+
]);
280+
}
281+
248282
/**
249283
* Forward a method call to the given method if an application instance exists.
250284
*

src/Illuminate/Foundation/Bus/PendingChain.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@ public function __construct($job, $chain)
7272
/**
7373
* Set the desired connection for the job.
7474
*
75-
* @param \UnitEnum|string|null $connection
75+
* @param string|null $connection
7676
* @return $this
7777
*/
7878
public function onConnection($connection)
7979
{
80-
$this->connection = enum_value($connection);
80+
$this->connection = $connection;
8181

8282
return $this;
8383
}
8484

8585
/**
8686
* Set the desired queue for the job.
8787
*
88-
* @param \UnitEnum|string|null $queue
88+
* @param \BackedEnum|string|null $queue
8989
* @return $this
9090
*/
9191
public function onQueue($queue)

src/Illuminate/Foundation/Cloud.php

Lines changed: 0 additions & 139 deletions
This file was deleted.

src/Illuminate/Foundation/Configuration/Middleware.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ public function appendToPriorityList($after, $append)
451451
public function getGlobalMiddleware()
452452
{
453453
$middleware = $this->global ?: array_values(array_filter([
454-
\Illuminate\Http\Middleware\ValidatePathEncoding::class,
455454
\Illuminate\Foundation\Http\Middleware\InvokeDeferredCallbacks::class,
456455
$this->trustHosts ? \Illuminate\Http\Middleware\TrustHosts::class : null,
457456
\Illuminate\Http\Middleware\TrustProxies::class,

src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ protected function installNodeDependencies()
187187
'yarn add --dev laravel-echo pusher-js',
188188
'yarn run build',
189189
];
190-
} elseif (file_exists(base_path('bun.lock')) || file_exists(base_path('bun.lockb'))) {
190+
} elseif (file_exists(base_path('bun.lockb'))) {
191191
$commands = [
192192
'bun add --dev laravel-echo pusher-js',
193193
'bun run build',

src/Illuminate/Foundation/Console/DownCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DownCommand extends Command
4242
public function handle()
4343
{
4444
try {
45-
if ($this->laravel->maintenanceMode()->active() && ! $this->getSecret()) {
45+
if ($this->laravel->maintenanceMode()->active()) {
4646
$this->components->info('Application is already down.');
4747

4848
return 0;

0 commit comments

Comments
 (0)