Skip to content

Commit e134ab4

Browse files
committed
fix conflicts
2 parents 6e3ac1f + 01805e5 commit e134ab4

File tree

23 files changed

+589
-396
lines changed

23 files changed

+589
-396
lines changed

.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/js/ziggy.js

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Our React starter kit provides a robust, modern starting point for building Lara
66

77
Inertia allows you to build modern, single-page React applications using classic server-side routing and controllers. This lets you enjoy the frontend power of React combined with the incredible backend productivity of Laravel and lightning-fast Vite compilation.
88

9-
This React starter kit utilizes React 19, TypeScript, Tailwind, and the [shadcn/ui](https://ui.shadcn.com) component library.
9+
This React starter kit utilizes React 19, TypeScript, Tailwind, and the [shadcn/ui](https://ui.shadcn.com) and [radix-ui](https://www.radix-ui.com) component libraries.
1010

1111
## Official Documentation
1212

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Closure;
6+
use Illuminate\Http\Request;
7+
use Illuminate\Support\Facades\View;
8+
use Symfony\Component\HttpFoundation\Response;
9+
10+
class HandleAppearance
11+
{
12+
/**
13+
* Handle an incoming request.
14+
*
15+
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
16+
*/
17+
public function handle(Request $request, Closure $next): Response
18+
{
19+
View::share('appearance', $request->cookie('appearance') ?? 'system');
20+
21+
return $next($request);
22+
}
23+
}

app/Http/Middleware/HandleInertiaRequests.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Foundation\Inspiring;
66
use Illuminate\Http\Request;
77
use Inertia\Middleware;
8+
use Tighten\Ziggy\Ziggy;
89

910
class HandleInertiaRequests extends Middleware
1011
{
@@ -45,6 +46,10 @@ public function share(Request $request): array
4546
'auth' => [
4647
'user' => $request->user(),
4748
],
49+
'ziggy' => fn (): array => [
50+
...(new Ziggy)->toArray(),
51+
'location' => $request->url(),
52+
]
4853
];
4954
}
5055
}

bootstrap/app.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use App\Http\Middleware\HandleAppearance;
34
use App\Http\Middleware\HandleInertiaRequests;
45
use Illuminate\Foundation\Application;
56
use Illuminate\Foundation\Configuration\Exceptions;
@@ -13,7 +14,10 @@
1314
health: '/up',
1415
)
1516
->withMiddleware(function (Middleware $middleware) {
17+
$middleware->encryptCookies(except: ['appearance']);
18+
1619
$middleware->web(append: [
20+
HandleAppearance::class,
1721
HandleInertiaRequests::class,
1822
AddLinkHeadersForPreloadedAssets::class,
1923
]);

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
"dev": [
5757
"Composer\\Config::disableProcessTimeout",
5858
"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"
59+
],
60+
"dev:ssr": [
61+
"npm run build:ssr",
62+
"Composer\\Config::disableProcessTimeout",
63+
"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"
5964
]
6065
},
6166
"extra": {

config/inertia.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Server Side Rendering
8+
|--------------------------------------------------------------------------
9+
|
10+
| These options configures if and how Inertia uses Server Side Rendering
11+
| to pre-render each initial request made to your application's pages
12+
| so that server rendered HTML is delivered for the user's browser.
13+
|
14+
| See: https://inertiajs.com/server-side-rendering
15+
|
16+
*/
17+
18+
'ssr' => [
19+
'enabled' => true,
20+
'url' => 'http://127.0.0.1:13714',
21+
// 'bundle' => base_path('bootstrap/ssr/ssr.mjs'),
22+
23+
],
24+
25+
/*
26+
|--------------------------------------------------------------------------
27+
| Testing
28+
|--------------------------------------------------------------------------
29+
|
30+
| The values described here are used to locate Inertia components on the
31+
| filesystem. For instance, when using `assertInertia`, the assertion
32+
| attempts to locate the component as a file relative to the paths.
33+
|
34+
*/
35+
36+
'testing' => [
37+
38+
'ensure_pages_exist' => true,
39+
40+
'page_paths' => [
41+
resource_path('js/pages'),
42+
],
43+
44+
'page_extensions' => [
45+
'js',
46+
'jsx',
47+
'svelte',
48+
'ts',
49+
'tsx',
50+
'vue',
51+
],
52+
53+
],
54+
55+
];

0 commit comments

Comments
 (0)