fix(attachment): memperbaiki argumen upload attachment
This commit is contained in:
parent
4fc0a06061
commit
f064f4da8f
@ -88,7 +88,7 @@ public function update(ExpenseRequest $request, Expense $expense): RedirectRespo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($validatedData['proof'])) {
|
if (isset($validatedData['proof'])) {
|
||||||
$this->uploadAttachment($validatedData['proof'], 'expenses', Expense::class, $expense->id, 'expenses');
|
$this->uploadAttachment($validatedData['proof'], 'expenses', Expense::class, $expense->id, 'expenses');k
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -106,7 +106,7 @@ public function store(AttendanceRequest $request): JsonResponse
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->uploadAttachment($validatedData['image'], 'attendances', Attendance::class, $newAttendance->id);
|
$this->uploadAttachment($validatedData['image'], 'attendances', Attendance::class, $newAttendance->id, 'attendance');
|
||||||
});
|
});
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public function store(InventoryRequest $request): RedirectResponse
|
|||||||
'user_id' => Auth::id(),
|
'user_id' => Auth::id(),
|
||||||
'barbershop_id' => Auth::user()->barbershop_id,
|
'barbershop_id' => Auth::user()->barbershop_id,
|
||||||
]));
|
]));
|
||||||
$this->uploadAttachment($validatedData['image'], 'inventory', Inventory::class, $newInventory->id);
|
$this->uploadAttachment($validatedData['image'], 'inventory', Inventory::class, $newInventory->id, 'inventory');
|
||||||
});
|
});
|
||||||
notify()->success('Data berhasil ditambahkan', 'Berhasil');
|
notify()->success('Data berhasil ditambahkan', 'Berhasil');
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ public function update(Inventory $inventory, InventoryRequest $request): Redirec
|
|||||||
$inventory->update($validatedData);
|
$inventory->update($validatedData);
|
||||||
|
|
||||||
if (isset($validatedData['image'])) {
|
if (isset($validatedData['image'])) {
|
||||||
$this->uploadAttachment($validatedData['image'], 'inventory', Inventory::class, $inventory->id);
|
$this->uploadAttachment($validatedData['image'], 'inventory', Inventory::class, $inventory->id, 'inventory');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public function store(BarbershopRequest $request): RedirectResponse
|
|||||||
|
|
||||||
DB::transaction(function () use ($validatedData) {
|
DB::transaction(function () use ($validatedData) {
|
||||||
$newBarbershop = Barbershop::create($validatedData);
|
$newBarbershop = Barbershop::create($validatedData);
|
||||||
$this->uploadAttachment($validatedData['image'], 'barbershop', Barbershop::class, $newBarbershop->id);
|
$this->uploadAttachment($validatedData['image'], 'barbershop', Barbershop::class, $newBarbershop->id, 'barbeshop');
|
||||||
});
|
});
|
||||||
|
|
||||||
notify()->success('Data berhasil ditambahkan', 'Berhasil');
|
notify()->success('Data berhasil ditambahkan', 'Berhasil');
|
||||||
@ -59,7 +59,7 @@ public function update(Barbershop $barbershop, BarbershopRequest $request): Redi
|
|||||||
DB::transaction(function () use ($barbershop, $validatedData) {
|
DB::transaction(function () use ($barbershop, $validatedData) {
|
||||||
$barbershop->update($validatedData);
|
$barbershop->update($validatedData);
|
||||||
if (isset($validatedData['image'])) {
|
if (isset($validatedData['image'])) {
|
||||||
$this->uploadAttachment($validatedData['image'], 'barbershop', Barbershop::class, $barbershop->id);
|
$this->uploadAttachment($validatedData['image'], 'barbershop', Barbershop::class, $barbershop->id, 'barbershop');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user