Skip to content

Commit 9fad317

Browse files
Merge pull request #200 from laravel/main
Update preview
2 parents fdea26f + 6646aee commit 9fad317

File tree

223 files changed

+5781
-4809
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+5781
-4809
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88

99
CHANGELOG.md export-ignore
1010
README.md export-ignore
11+
.github/workflows/browser-tests.yml export-ignore
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: browser-tests
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
pull_request:
9+
branches:
10+
- develop
11+
- main
12+
13+
jobs:
14+
ci:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: 8.4
25+
tools: composer:v2
26+
coverage: xdebug
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '22'
32+
cache: 'npm'
33+
34+
- name: Install Node Dependencies
35+
run: npm ci
36+
37+
- name: Install Playwright Dependencies
38+
run: npm install playwright@latest
39+
40+
- name: Install Playwright Browsers
41+
run: npx playwright install --with-deps
42+
43+
- name: Add `laravel-labs/starter-kit-browser-tests` Repository
44+
run: |
45+
composer config repositories.browser-tests '{"type": "vcs", "url": "https://github.com/laravel-labs/starter-kit-browser-tests"}' --file composer.json
46+
composer remove "phpunit/phpunit" --dev --no-update
47+
composer require "laravel-labs/starter-kit-browser-tests:dev-main@dev" --dev --no-update
48+
49+
- name: Install Dependencies
50+
run: composer install --no-interaction --prefer-dist --optimize-autoloader
51+
52+
- name: Copy Environment File
53+
run: cp .env.example .env
54+
55+
- name: Generate Application Key
56+
run: php artisan key:generate
57+
58+
- name: Setup Test Environment
59+
run: |
60+
cp vendor/laravel-labs/starter-kit-browser-tests/phpunit.xml.dist .
61+
rm phpunit.xml
62+
rm -Rf tests/
63+
cp -rf vendor/laravel-labs/starter-kit-browser-tests/tests/ tests/
64+
65+
- name: Build Assets
66+
run: npm run build
67+
68+
- name: Tests
69+
run: php vendor/bin/pest

.github/workflows/tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ jobs:
4343
- name: Generate Application Key
4444
run: php artisan key:generate
4545

46-
- name: Publish Ziggy Configuration
47-
run: php artisan ziggy:generate
48-
4946
- name: Build Assets
5047
run: npm run build
5148

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
/public/storage
77
/storage/*.key
88
/storage/pail
9+
/resources/js/actions
10+
/resources/js/routes
11+
/resources/js/wayfinder
912
/vendor
13+
.DS_Store
1014
.env
1115
.env.backup
1216
.env.production

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
resources/js/components/ui/*
2+
resources/views/mail/*

.prettierrc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
"singleQuote": true,
44
"singleAttributePerLine": false,
55
"htmlWhitespaceSensitivity": "css",
6-
"printWidth": 150,
7-
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"],
8-
"tailwindFunctions": ["clsx", "cn"],
6+
"printWidth": 80,
7+
"plugins": [
8+
"prettier-plugin-organize-imports",
9+
"prettier-plugin-tailwindcss"
10+
],
11+
"tailwindFunctions": [
12+
"clsx",
13+
"cn",
14+
"cva"
15+
],
16+
"tailwindStylesheet": "resources/css/app.css",
917
"tabWidth": 4,
1018
"overrides": [
1119
{

app/Http/Controllers/Auth/AuthenticatedSessionController.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Illuminate\Support\Facades\Route;
1111
use Inertia\Inertia;
1212
use Inertia\Response;
13+
use Laravel\Fortify\Features;
1314

1415
class AuthenticatedSessionController extends Controller
1516
{
@@ -29,7 +30,18 @@ public function create(Request $request): Response
2930
*/
3031
public function store(LoginRequest $request): RedirectResponse
3132
{
32-
$request->authenticate();
33+
$user = $request->validateCredentials();
34+
35+
if (Features::enabled(Features::twoFactorAuthentication()) && $user->hasEnabledTwoFactorAuthentication()) {
36+
$request->session()->put([
37+
'login.id' => $user->getKey(),
38+
'login.remember' => $request->boolean('remember'),
39+
]);
40+
41+
return to_route('two-factor.login');
42+
}
43+
44+
Auth::login($user, $request->boolean('remember'));
3345

3446
$request->session()->regenerate();
3547

app/Http/Controllers/Auth/ConfirmablePasswordController.php

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

app/Http/Controllers/Auth/RegisteredUserController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public function store(Request $request): RedirectResponse
4646

4747
Auth::login($user);
4848

49+
$request->session()->regenerate();
50+
4951
return to_route('dashboard');
5052
}
5153
}

app/Http/Controllers/Auth/VerifyEmailController.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace App\Http\Controllers\Auth;
44

55
use App\Http\Controllers\Controller;
6-
use Illuminate\Auth\Events\Verified;
76
use Illuminate\Foundation\Auth\EmailVerificationRequest;
87
use Illuminate\Http\RedirectResponse;
98

@@ -18,11 +17,7 @@ public function __invoke(EmailVerificationRequest $request): RedirectResponse
1817
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
1918
}
2019

21-
if ($request->user()->markEmailAsVerified()) {
22-
/** @var \Illuminate\Contracts\Auth\MustVerifyEmail $user */
23-
$user = $request->user();
24-
event(new Verified($user));
25-
}
20+
$request->fulfill();
2621

2722
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
2823
}

0 commit comments

Comments
 (0)