Last commit before showcase.

This commit is contained in:
Simon Pocrnjič
2024-11-14 21:02:10 +01:00
parent 953ff38d64
commit ad8b3c07e1
16 changed files with 302 additions and 143 deletions
+11 -5
View File
@@ -60,9 +60,9 @@ public function store(Request $request)
'full_name' => $pq['full_name'],
'gender' => null,
'birthday' => null,
'tax_number' => null,
'social_security_number' => null,
'description' => 'sdwwf',
'tax_number' => $pq['tax_number'],
'social_security_number' => $pq['social_security_number'],
'description' => $pq['description'],
'group_id' => 2,
'type_id' => 1
]);
@@ -73,6 +73,12 @@ public function store(Request $request)
'type_id' => $pq['address']['type_id']
]);
$person->phones()->create([
'nu' => $pq['phone']['nu'],
'country_code' => $pq['phone']['country_code'],
'type_id' => $pq['phone']['type_id']
]);
$person->clientCase()->create([
'client_id' => $client->id
]);
@@ -147,11 +153,11 @@ public function deleteContract(ClientCase $clientCase, String $uuid, Request $re
public function show(ClientCase $clientCase)
{
$case = $clientCase::with([
'person' => fn($que) => $que->with('addresses')
'person' => fn($que) => $que->with(['addresses', 'phones'])
])->where('active', 1)->findOrFail($clientCase->id);
return Inertia::render('Cases/Show', [
'client' => $case->client()->with('person', fn($q) => $q->with(['addresses']))->firstOrFail(),
'client' => $case->client()->with('person', fn($q) => $q->with(['addresses', 'phones']))->firstOrFail(),
'client_case' => $case,
'contracts' => $case->contracts()
->with(['type'])