changes
This commit is contained in:
@@ -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
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user