File tree 6 files changed +51
-6
lines changed
6 files changed +51
-6
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace App \Http \Controllers ;
4
+ use Inertia \Inertia ;
5
+ use App \Models \Repair ;
6
+
7
+ class RepairController extends Controller
8
+ {
9
+ public function index ()
10
+ {
11
+ return Inertia::render ('Repairs ' , [
12
+ 'repairs ' => Repair::all ()
13
+ ]);
14
+ }
15
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace App \Http \Controllers ;
4
+ use Inertia \Inertia ;
5
+ use App \Models \Vehicle ;
6
+
7
+ class VehicleController extends Controller
8
+ {
9
+ public function index ()
10
+ {
11
+ return Inertia::render ('Vehicles ' , [
12
+ 'vehicles ' => Vehicle::all ()
13
+ ]);
14
+ }
15
+ }
Original file line number Diff line number Diff line change 1
1
<script setup>
2
+ import { router } from ' @inertiajs/vue3' ;
2
3
defineProps ({
3
4
title: String ,
4
5
description: String ,
@@ -10,8 +11,8 @@ defineProps({
10
11
</script >
11
12
12
13
<template >
13
- <a
14
- :href = " link"
14
+ <div
15
+ @click = " router.get( link) "
15
16
class =" tile-container"
16
17
:style =" {
17
18
backgroundColor: bgColor || '#ffffff',
@@ -23,7 +24,7 @@ defineProps({
23
24
<h3 class =" tile-title" >{{ title }}</h3 >
24
25
<p class =" tile-description" >{{ description }}</p >
25
26
</div >
26
- </a >
27
+ </div >
27
28
</template >
28
29
29
30
Original file line number Diff line number Diff line change 1
1
<script setup>
2
+ const props = defineProps ({
3
+ repairs: Array
4
+ });
2
5
</script >
3
6
4
7
<template >
5
- <p >repairs page working</p >
6
- </template >
8
+ <div class =" repairs" v-for =" repair in repairs" :key =" repair.id" >
9
+ <span >id: {{ repair.id }}, state: {{ repair.status }}</span >
10
+ </div >
11
+ </template >
Original file line number Diff line number Diff line change 1
1
<script setup>
2
+ const props = defineProps ({
3
+ vehicles: Array
4
+ });
2
5
</script >
3
6
4
7
<template >
5
- <p >vehicles page working</p >
8
+ <div class =" vehicles" v-for =" vehicle in vehicles" :key =" vehicle.id" >
9
+ <span >name: {{ vehicle.client_id }}, plate: {{ vehicle.plate_number }}</span >
10
+ </div >
6
11
</template >
Original file line number Diff line number Diff line change 6
6
use Inertia \Inertia ;
7
7
use App \Http \Controllers \UserController ;
8
8
use App \Http \Controllers \ClientController ;
9
+ use App \Http \Controllers \VehicleController ;
10
+ use App \Http \Controllers \RepairController ;
9
11
10
12
Route::get ('/ ' , function () {
11
13
return Inertia::render ('Welcome ' , [
31
33
32
34
//pages routes
33
35
Route::get ('/clients ' , [ClientController::class, 'index ' ])->name ('clients ' );
36
+ Route::get ('/vehicles ' , [VehicleController::class, 'index ' ])->name ('vehicles ' );
37
+ Route::get ('/repairs ' , [RepairController::class, 'index ' ])->name ('repairs ' );
34
38
35
39
require __DIR__ .'/auth.php ' ;
You can’t perform that action at this time.
0 commit comments