refactor: memperbaiki fitur yang ada upload attachementnya
This commit is contained in:
parent
8d7d455a7b
commit
36408541c5
@ -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');k
|
$this->uploadAttachment($validatedData['proof'], 'expenses', Expense::class, $expense->id, 'expenses');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ public function create(): View
|
|||||||
{
|
{
|
||||||
return view('pages.admin.finance.payroll.create', [
|
return view('pages.admin.finance.payroll.create', [
|
||||||
'pageTitle' => 'Tambah Gaji',
|
'pageTitle' => 'Tambah Gaji',
|
||||||
'employees' => User::query()->barbershop()->latest()->get(),
|
'employees' => User::with('biography')->barbershop()->latest()->get(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ public function edit(Payroll $payroll): View
|
|||||||
{
|
{
|
||||||
return view('pages.admin.finance.payroll.edit', [
|
return view('pages.admin.finance.payroll.edit', [
|
||||||
'pageTitle' => 'Edit Gaji',
|
'pageTitle' => 'Edit Gaji',
|
||||||
'employees' => User::query()->barbershop()->latest()->get(),
|
'employees' => User::with('biography')->barbershop()->latest()->get(),
|
||||||
'payroll' => $payroll,
|
'payroll' => $payroll,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,6 +99,11 @@ public function cash(): HasMany
|
|||||||
return $this->hasMany(Cash::class);
|
return $this->hasMany(Cash::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function debts(): HasMany
|
||||||
|
{
|
||||||
|
return $this->hasMany(Debt::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function attachments(): MorphMany
|
public function attachments(): MorphMany
|
||||||
{
|
{
|
||||||
return $this->morphMany(Attachment::class, 'attachmentable');
|
return $this->morphMany(Attachment::class, 'attachmentable');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user