removed extra brackets
This commit is contained in:
@ -19,7 +19,7 @@ class Users extends ApiController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$users = User::with(['companies', 'roles', 'permissions'])->collect();
|
||||
$users = User::with('companies', 'permissions', 'roles')->collect();
|
||||
|
||||
return $this->response->paginator($users, new Transformer());
|
||||
}
|
||||
@ -34,9 +34,9 @@ class Users extends ApiController
|
||||
{
|
||||
// Check if we're querying by id or email
|
||||
if (is_numeric($id)) {
|
||||
$user = User::with(['companies', 'roles', 'permissions'])->find($id);
|
||||
$user = User::with('companies', 'permissions', 'roles')->find($id);
|
||||
} else {
|
||||
$user = User::with(['companies', 'roles', 'permissions'])->where('email', $id)->first();
|
||||
$user = User::with('companies', 'permissions', 'roles')->where('email', $id)->first();
|
||||
}
|
||||
|
||||
return $this->response->item($user, new Transformer());
|
||||
|
@ -19,7 +19,7 @@ class Reconciliations extends ApiController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$items = Reconciliation::with(['account'])->collect();
|
||||
$items = Reconciliation::with('account')->collect();
|
||||
|
||||
return $this->response->paginator($items, new Transformer());
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class Transactions extends ApiController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$transactions = Transaction::with(['account', 'category', 'contact'])->collect(['paid_at'=> 'desc']);
|
||||
$transactions = Transaction::with('account', 'category', 'contact')->collect(['paid_at'=> 'desc']);
|
||||
|
||||
return $this->response->paginator($transactions, new Transformer());
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class Transfers extends ApiController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$transfers = Transfer::with([
|
||||
$transfers = Transfer::with(
|
||||
'expense_transaction', 'expense_transaction.account', 'income_transaction', 'income_transaction.account'
|
||||
])->collect('expense_transaction.paid_at');
|
||||
)->collect('expense_transaction.paid_at');
|
||||
|
||||
$special_key = [
|
||||
'expense_transaction.name' => 'from_account',
|
||||
|
@ -22,7 +22,7 @@ class Items extends ApiController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$items = Item::with(['category', 'tax'])->collect();
|
||||
$items = Item::with('category', 'tax')->collect();
|
||||
|
||||
return $this->response->paginator($items, new Transformer());
|
||||
}
|
||||
@ -35,7 +35,7 @@ class Items extends ApiController
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$item = Item::with(['category', 'tax'])->find($id);
|
||||
$item = Item::with('category', 'tax')->find($id);
|
||||
|
||||
return $this->response->item($item, new Transformer());
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class Bills extends ApiController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$bills = Bill::with(['contact', 'items', 'transactions', 'histories'])->collect(['billed_at'=> 'desc']);
|
||||
$bills = Bill::with('contact', 'histories', 'items', 'transactions')->collect(['billed_at'=> 'desc']);
|
||||
|
||||
return $this->response->paginator($bills, new Transformer());
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class Invoices extends ApiController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$invoices = Invoice::with(['contact', 'items', 'transactions', 'histories'])->collect(['invoiced_at'=> 'desc']);
|
||||
$invoices = Invoice::with('contact', 'histories', 'items', 'transactions')->collect(['invoiced_at'=> 'desc']);
|
||||
|
||||
return $this->response->paginator($invoices, new Transformer());
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class Users extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$users = User::with(['media', 'roles'])->collect();
|
||||
$users = User::with('media', 'roles')->collect();
|
||||
|
||||
return view('auth.users.index', compact('users'));
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class Transactions extends Controller
|
||||
$request_type = !request()->has('type') ? ['income', 'expense'] : request('type');
|
||||
$categories = Category::enabled()->type($request_type)->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
$transactions = Transaction::with(['account', 'category', 'contact'])->collect(['paid_at'=> 'desc']);
|
||||
$transactions = Transaction::with('account', 'category', 'contact')->collect(['paid_at'=> 'desc']);
|
||||
|
||||
return view('banking.transactions.index', compact('transactions', 'accounts', 'types', 'categories'));
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ class Transfers extends Controller
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$items = Transfer::with([
|
||||
$items = Transfer::with(
|
||||
'expense_transaction', 'expense_transaction.account', 'income_transaction', 'income_transaction.account'
|
||||
])->collect(['expense_transaction.paid_at' => 'desc']);
|
||||
)->collect(['expense_transaction.paid_at' => 'desc']);
|
||||
|
||||
foreach ($items as $item) {
|
||||
$income_transaction = $item->income_transaction;
|
||||
|
@ -28,7 +28,7 @@ class Items extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$items = Item::with(['category', 'media'])->collect();
|
||||
$items = Item::with('category', 'media')->collect();
|
||||
|
||||
return view('common.items.index', compact('items'));
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class Invoices extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$invoices = Invoice::with(['contact', 'items', 'payments', 'histories'])
|
||||
$invoices = Invoice::with('contact', 'histories', 'items', 'payments')
|
||||
->accrued()->where('contact_id', user()->contact->id)
|
||||
->collect(['invoice_number'=> 'desc']);
|
||||
|
||||
|
@ -37,7 +37,7 @@ class Bills extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$bills = Bill::with(['contact', 'transactions'])->collect(['billed_at'=> 'desc']);
|
||||
$bills = Bill::with('contact', 'transactions')->collect(['billed_at'=> 'desc']);
|
||||
|
||||
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
|
@ -30,7 +30,7 @@ class Payments extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$payments = Transaction::with(['account', 'bill', 'category', 'contact'])->expense()->isNotTransfer()->collect(['paid_at'=> 'desc']);
|
||||
$payments = Transaction::with('account', 'bill', 'category', 'contact')->expense()->isNotTransfer()->collect(['paid_at'=> 'desc']);
|
||||
|
||||
$vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
|
@ -38,7 +38,7 @@ class Invoices extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$invoices = Invoice::with(['contact', 'transactions'])->collect(['invoice_number'=> 'desc']);
|
||||
$invoices = Invoice::with('contact', 'transactions')->collect(['invoice_number'=> 'desc']);
|
||||
|
||||
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
|
@ -30,7 +30,7 @@ class Revenues extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$revenues = Transaction::with(['account', 'category', 'contact', 'invoice'])->income()->isNotTransfer()->collect(['paid_at'=> 'desc']);
|
||||
$revenues = Transaction::with('account', 'category', 'contact', 'invoice')->income()->isNotTransfer()->collect(['paid_at'=> 'desc']);
|
||||
|
||||
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
|
Reference in New Issue
Block a user