improved performance
This commit is contained in:
@ -28,7 +28,7 @@ class Items extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$items = Item::with(['category', 'tax'])->collect();
|
||||
$items = Item::with('category')->collect();
|
||||
|
||||
return view('common.items.index', compact('items'));
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class Bills extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$bills = Bill::with(['contact', 'items', 'histories', 'transactions'])->collect(['billed_at'=> 'desc']);
|
||||
$bills = Bill::with('contact')->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::expense()->with(['account', 'category', 'contact'])->isNotTransfer()->collect(['paid_at'=> 'desc']);
|
||||
$payments = Transaction::with(['account', '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', 'items', 'histories', 'transactions'])->collect(['invoice_number'=> 'desc']);
|
||||
$invoices = Invoice::with('contact')->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::income()->with(['account', 'category', 'contact'])->isNotTransfer()->collect(['paid_at'=> 'desc']);
|
||||
$revenues = Transaction::with(['account', 'category', 'contact'])->income()->isNotTransfer()->collect(['paid_at'=> 'desc']);
|
||||
|
||||
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
|
Reference in New Issue
Block a user