improved performance

This commit is contained in:
Denis Duliçi
2020-06-06 21:47:02 +03:00
parent f003f99d71
commit 657c86a29c
11 changed files with 22 additions and 22 deletions

View File

@ -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');

View File

@ -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');