added responsable class to index

This commit is contained in:
Denis Duliçi
2020-11-06 00:43:46 +03:00
parent 96963ef0e1
commit e5a7f5b15e
31 changed files with 139 additions and 32 deletions

View File

@ -21,7 +21,7 @@ class Accounts extends Controller
{
$accounts = Account::collect();
return view('banking.accounts.index', compact('accounts'));
return $this->response('banking.accounts.index', compact('accounts'));
}
/**

View File

@ -26,7 +26,7 @@ class Reconciliations extends Controller
$accounts = collect(Account::enabled()->orderBy('name')->pluck('name', 'id'));
return view('banking.reconciliations.index', compact('reconciliations', 'accounts'));
return $this->response('banking.reconciliations.index', compact('reconciliations', 'accounts'));
}
/**

View File

@ -30,7 +30,7 @@ class Transactions extends Controller
$transactions = Transaction::with('account', 'category', 'contact')->collect(['paid_at'=> 'desc']);
return view('banking.transactions.index', compact('transactions', 'accounts', 'types', 'categories'));
return $this->response('banking.transactions.index', compact('transactions', 'accounts', 'types', 'categories'));
}
/**

View File

@ -52,10 +52,10 @@ class Transfers extends Controller
];
}
$special_key = array(
$special_key = [
'expense_transaction.name' => 'from_account',
'income_transaction.name' => 'to_account',
);
];
$request = request();
@ -77,12 +77,12 @@ class Transfers extends Controller
array_multisort($sort_order, $sort_type, $data);
}
$transfers = $this->paginate($data);
$transfers = $request->expectsJson() ? $data : $this->paginate($data);
$accounts = collect(Account::enabled()->orderBy('name')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
return view('banking.transfers.index', compact('transfers', 'accounts'));
return $this->response('banking.transfers.index', compact('transfers', 'accounts'));
}
/**