Skip to content

Commit 7bb0658

Browse files
Merge branch 'laravel:main' into dev
2 parents 1861438 + a112a23 commit 7bb0658

File tree

18 files changed

+35
-83
lines changed

18 files changed

+35
-83
lines changed

app/Http/Controllers/Settings/PasswordController.php

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

55
use App\Http\Controllers\Controller;
6-
use Illuminate\Contracts\Auth\MustVerifyEmail;
76
use Illuminate\Http\RedirectResponse;
87
use Illuminate\Http\Request;
98
use Illuminate\Support\Facades\Hash;
@@ -16,12 +15,9 @@ class PasswordController extends Controller
1615
/**
1716
* Show the user's password settings page.
1817
*/
19-
public function edit(Request $request): Response
18+
public function edit(): Response
2019
{
21-
return Inertia::render('settings/password', [
22-
'mustVerifyEmail' => $request->user() instanceof MustVerifyEmail,
23-
'status' => $request->session()->get('status'),
24-
]);
20+
return Inertia::render('settings/password');
2521
}
2622

2723
/**

app/Http/Middleware/HandleInertiaRequests.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public function share(Request $request): array
4949
'ziggy' => fn (): array => [
5050
...(new Ziggy)->toArray(),
5151
'location' => $request->url(),
52-
]
52+
],
53+
'sidebarOpen' => ! $request->hasCookie('sidebar_state') || $request->cookie('sidebar_state') === 'true',
5354
];
5455
}
5556
}

bootstrap/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
health: '/up',
1515
)
1616
->withMiddleware(function (Middleware $middleware) {
17-
$middleware->encryptCookies(except: ['appearance']);
17+
$middleware->encryptCookies(except: ['appearance', 'sidebar_state']);
1818

1919
$middleware->web(append: [
2020
HandleAppearance::class,

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
"npm run build:ssr",
6161
"Composer\\Config::disableProcessTimeout",
6262
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"php artisan inertia:start-ssr\" --names=server,queue,logs,ssr"
63+
],
64+
"test": [
65+
"@php artisan config:clear --ansi",
66+
"@php artisan test"
6367
]
6468
},
6569
"extra": {

public/apple-touch-icon.png

1.62 KB
Loading

public/favicon.ico

4.19 KB
Binary file not shown.

public/favicon.svg

Lines changed: 3 additions & 0 deletions
Loading

resources/js/components/app-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const rightNavItems: NavItem[] = [
3131
},
3232
{
3333
title: 'Documentation',
34-
href: 'https://laravel.com/docs/starter-kits',
34+
href: 'https://laravel.com/docs/starter-kits#react',
3535
icon: BookOpen,
3636
},
3737
];
Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
import { SidebarProvider } from '@/components/ui/sidebar';
2-
import { useState } from 'react';
2+
import { SharedData } from '@/types';
3+
import { usePage } from '@inertiajs/react';
34

45
interface AppShellProps {
56
children: React.ReactNode;
67
variant?: 'header' | 'sidebar';
78
}
89

910
export function AppShell({ children, variant = 'header' }: AppShellProps) {
10-
const [isOpen, setIsOpen] = useState(() => (typeof window !== 'undefined' ? localStorage.getItem('sidebar') !== 'false' : true));
11-
12-
const handleSidebarChange = (open: boolean) => {
13-
setIsOpen(open);
14-
15-
if (typeof window !== 'undefined') {
16-
localStorage.setItem('sidebar', String(open));
17-
}
18-
};
11+
const isOpen = usePage<SharedData>().props.sidebarOpen;
1912

2013
if (variant === 'header') {
2114
return <div className="flex min-h-screen w-full flex-col">{children}</div>;
2215
}
2316

24-
return (
25-
<SidebarProvider defaultOpen={isOpen} open={isOpen} onOpenChange={handleSidebarChange}>
26-
{children}
27-
</SidebarProvider>
28-
);
17+
return <SidebarProvider defaultOpen={isOpen}>{children}</SidebarProvider>;
2918
}

resources/js/components/app-sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const footerNavItems: NavItem[] = [
2323
},
2424
{
2525
title: 'Documentation',
26-
href: 'https://laravel.com/docs/starter-kits',
26+
href: 'https://laravel.com/docs/starter-kits#react',
2727
icon: BookOpen,
2828
},
2929
];

0 commit comments

Comments
 (0)