refactor(debt): data untuk kasir dan barber itu sesuai akun nya
This commit is contained in:
parent
304b93c2f6
commit
e5a70da344
@ -23,7 +23,7 @@ public function index(): View
|
|||||||
return view('pages.admin.finance.debts', [
|
return view('pages.admin.finance.debts', [
|
||||||
'pageTitle' => 'Kasbon',
|
'pageTitle' => 'Kasbon',
|
||||||
'debts' => Debt::with(['user', 'user.biography'])
|
'debts' => Debt::with(['user', 'user.biography'])
|
||||||
->when(auth()->user()->role_id === 4, function ($query) {
|
->when(in_array(auth()->user()->role_id, [4, 5]), function ($query) {
|
||||||
return $query->where('user_id', auth()->id());
|
return $query->where('user_id', auth()->id());
|
||||||
})
|
})
|
||||||
->latest()
|
->latest()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user