Skip to content

Commit 1217d34

Browse files
authored
Merge pull request #300 from tighten/shift-158384
Laravel 12.x Shift
2 parents 5ca360c + 53f0b4f commit 1217d34

35 files changed

+1019
-1041
lines changed

.env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ APP_KEY=
44
APP_DEBUG=true
55
APP_URL=http://laravelversions.test
66

7-
APP_TIMEZONE=UTC
87
APP_LOCALE=en
98
APP_FALLBACK_LOCALE=en
109
APP_FAKER_LOCALE=en_US
1110
APP_MAINTENANCE_DRIVER=file
1211
APP_MAINTENANCE_STORE=database
12+
PHP_CLI_SERVER_WORKERS=4
13+
1314
BCRYPT_ROUNDS=12
1415

1516
LOG_CHANNEL=stack,flare
@@ -43,7 +44,7 @@ MAIL_HOST=mailhog
4344
MAIL_PORT=1025
4445
MAIL_USERNAME=null
4546
MAIL_PASSWORD=null
46-
MAIL_ENCRYPTION=null
47+
MAIL_SCHEME=null
4748
MAIL_FROM_ADDRESS=null
4849
MAIL_FROM_NAME="${APP_NAME}"
4950

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212

1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v5
1616

1717
- name: Setup PHP
1818
uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: 8.2
20+
php-version: 8.4
2121
extensions: posix, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
2222
coverage: none
2323

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/public/build
55
/public/storage
66
/storage/*.key
7+
/storage/pail
78
/vendor
89
.env
910
.env.backup
@@ -14,3 +15,4 @@ yarn-error.log
1415
storage/debugbar
1516
.DS_Store
1617
.phpunit.cache
18+
/.nova

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ Potential statuses:
9999
## Instructions for hosting/installing yourself
100100
### Requirements
101101

102-
* PHP >= 8.1 with [the extensions listed in the Laravel docs](https://laravel.com/docs/9.x/deployment#server-requirements)
103-
* A [supported relational database](http://laravel.com/docs/9.x/database#introduction) and corresponding PHP extension
102+
* PHP >= 8.4 with [the extensions listed in the Laravel docs](https://laravel.com/docs/12.x/deployment#server-requirements)
103+
* A [supported relational database](http://laravel.com/docs/12.x/database#introduction) and corresponding PHP extension
104104
* [Composer](https://getcomposer.org/download/)
105105
* [NPM](https://nodejs.org/)
106106

app/Http/Controllers/Controller.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,4 @@
22

33
namespace App\Http\Controllers;
44

5-
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
6-
use Illuminate\Foundation\Validation\ValidatesRequests;
7-
use Illuminate\Routing\Controller as BaseController;
8-
9-
abstract class Controller extends BaseController
10-
{
11-
use AuthorizesRequests, ValidatesRequests;
12-
}
5+
abstract class Controller {}

app/Models/LaravelVersion.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Models;
44

5+
use Illuminate\Database\Eloquent\Attributes\Scope;
56
use Illuminate\Database\Eloquent\Builder;
67
use Illuminate\Database\Eloquent\Collection;
78
use Illuminate\Database\Eloquent\Factories\HasFactory;
@@ -69,11 +70,6 @@ public function last(): HasOne
6970
->ofMany(['order' => 'MAX']);
7071
}
7172

72-
public function scopeReleased($query)
73-
{
74-
$query->where('released_at', '<=', now());
75-
}
76-
7773
public function getReleases(): Collection
7874
{
7975
return static::withoutGlobalScope('first')
@@ -159,6 +155,12 @@ public function needsNotification()
159155
return false;
160156
}
161157

158+
#[Scope]
159+
protected function released($query)
160+
{
161+
$query->where('released_at', '<=', now());
162+
}
163+
162164
protected function casts(): array
163165
{
164166
return [

artisan

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,18 @@
11
#!/usr/bin/env php
22
<?php
33

4-
define('LARAVEL_START', microtime(true));
4+
use Illuminate\Foundation\Application;
5+
use Symfony\Component\Console\Input\ArgvInput;
56

6-
/*
7-
|--------------------------------------------------------------------------
8-
| Register The Auto Loader
9-
|--------------------------------------------------------------------------
10-
|
11-
| Composer provides a convenient, automatically generated class loader
12-
| for our application. We just need to utilize it! We'll require it
13-
| into the script here so that we do not have to worry about the
14-
| loading of any our classes "manually". Feels great to relax.
15-
|
16-
*/
7+
define('LARAVEL_START', microtime(true));
178

9+
// Register the Composer autoloader...
1810
require __DIR__.'/vendor/autoload.php';
1911

12+
// Bootstrap Laravel and handle the command...
13+
/** @var Application $app */
2014
$app = require_once __DIR__.'/bootstrap/app.php';
2115

22-
/*
23-
|--------------------------------------------------------------------------
24-
| Run The Artisan Application
25-
|--------------------------------------------------------------------------
26-
|
27-
| When we run the console application, the current CLI command will be
28-
| executed in this console and the response sent back to a terminal
29-
| or another output device for the developers. Here goes nothing!
30-
|
31-
*/
32-
33-
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
34-
35-
$status = $kernel->handle(
36-
$input = new Symfony\Component\Console\Input\ArgvInput,
37-
new Symfony\Component\Console\Output\ConsoleOutput
38-
);
39-
40-
/*
41-
|--------------------------------------------------------------------------
42-
| Shutdown The Application
43-
|--------------------------------------------------------------------------
44-
|
45-
| Once Artisan has finished running, we will fire off the shutdown events
46-
| so that any final work may be done by the application before we shut
47-
| down the process. This is the last thing to happen to the request.
48-
|
49-
*/
50-
51-
$kernel->terminate($input, $status);
16+
$status = $app->handleCommand(new ArgvInput);
5217

5318
exit($status);

composer.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
],
99
"license": "MIT",
1010
"require": {
11-
"php": "^8.2",
12-
"codezero/laravel-localized-routes": "^4.0.1",
13-
"guzzlehttp/guzzle": "^7.9.2",
14-
"laravel/framework": "^11.45",
15-
"laravel/tinker": "^2.10",
11+
"php": "^8.4",
12+
"laravel/framework": "^12.28",
13+
"laravel/tinker": "^2.10.1",
14+
"opgginc/codezero-laravel-localized-routes": "^5.1",
1615
"phlak/semver": "^4.1",
1716
"silber/page-cache": "^1.1",
1817
"spatie/laravel-ignition": "^2.9"
@@ -21,11 +20,12 @@
2120
"barryvdh/laravel-debugbar": "^3.16",
2221
"brianium/paratest": "^7.7",
2322
"fakerphp/faker": "^1.24.1",
24-
"laravel/sail": "^1.40",
23+
"laravel/sail": "^1.41",
2524
"mockery/mockery": "^1.6.12",
26-
"nunomaduro/collision": "^8.5",
27-
"phpunit/phpunit": "^11.5.3",
28-
"tightenco/duster": "^3.1"
25+
"nunomaduro/collision": "^8.6",
26+
"phpunit/phpunit": "^12.0",
27+
"tightenco/duster": "^3.1",
28+
"laravel/pail": "^1.2.2"
2929
},
3030
"config": {
3131
"optimize-autoloader": true,
@@ -74,6 +74,10 @@
7474
],
7575
"fix": [
7676
"vendor/bin/duster fix"
77+
],
78+
"dev": [
79+
"Composer\\Config::disableProcessTimeout",
80+
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
7781
]
7882
}
7983
}

0 commit comments

Comments
 (0)