File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed
resources/js/pages/playground Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace App \Http \Controllers ;
4
+
5
+ use Illuminate \Http \Request ;
6
+ use Inertia \Inertia ;
7
+
8
+ class PlaygroundController extends Controller
9
+ {
10
+ /**
11
+ * Handle the incoming request.
12
+ */
13
+ public function __invoke (Request $ request )
14
+ {
15
+ return Inertia::render ('playground/index ' , [
16
+ 'data ' => [],
17
+ ]);
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ import AppLayout from '@/layouts/app-layout' ;
2
+ import AuthLayout from '@/layouts/auth-layout' ;
3
+
4
+ type Props = PageProps < {
5
+ data : unknown ;
6
+ } > ;
7
+
8
+ function Index ( { data, user } : Props ) {
9
+ const Layout = user ? AppLayout : AuthLayout ;
10
+
11
+ return (
12
+ < Layout
13
+ title = "Playground"
14
+ description = "Playground for testing and experimenting with features"
15
+ >
16
+ < pre > { JSON . stringify ( data , null , 2 ) } </ pre >
17
+ </ Layout >
18
+ ) ;
19
+ }
20
+
21
+ export default Index ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ use App \Http \Controllers \PlaygroundController ;
3
4
use Illuminate \Support \Facades \Route ;
4
5
use Inertia \Inertia ;
5
6
7
+ if (config ('app.debug ' )) {
8
+ Route::get ('playground ' , PlaygroundController::class)->name ('playground ' );
9
+ }
10
+
6
11
Route::get ('/ ' , function () {
7
12
return Inertia::render ('welcome ' );
8
13
})->name ('home ' );
You can’t perform that action at this time.
0 commit comments