This commit is contained in:
Simon Pocrnjič
2025-01-02 18:38:47 +01:00
parent 0c3bbfe18f
commit 0f8cfd3f16
41 changed files with 2013 additions and 591 deletions
+15 -2
View File
@@ -131,7 +131,14 @@ public function storeActivity(ClientCase $clientCase, Request $request) {
]);
//Create activity
$clientCase->activities()->create($attributes);
$activity = $clientCase->activities()->create($attributes);
foreach ($activity->decision->events as $e) {
$class = '\\App\\Events\\' . $e->name;
event(new $class($clientCase));
}
return to_route('clientCase.show', $clientCase);
@@ -156,6 +163,11 @@ public function show(ClientCase $clientCase)
'person' => fn($que) => $que->with(['addresses', 'phones'])
])->where('active', 1)->findOrFail($clientCase->id);
$types = [
'address_types' => \App\Models\Person\AddressType::all(),
'phone_types' => \App\Models\Person\PhoneType::all()
];
return Inertia::render('Cases/Show', [
'client' => $case->client()->with('person', fn($q) => $q->with(['addresses', 'phones']))->firstOrFail(),
'client_case' => $case,
@@ -166,7 +178,8 @@ public function show(ClientCase $clientCase)
->orderByDesc('created_at')
->paginate(20, ['*'], 'activities'),
'contract_types' => \App\Models\ContractType::whereNull('deleted_at')->get(),
'actions' => \App\Models\Action::with('decisions')->get()
'actions' => \App\Models\Action::with('decisions')->get(),
'types' => $types
]);
}