more eager loading

This commit is contained in:
Denis Duliçi
2020-06-06 22:57:29 +03:00
parent 657c86a29c
commit a16406ea1e
10 changed files with 11 additions and 11 deletions

View File

@ -38,7 +38,7 @@ class Invoices extends Controller
*/
public function index()
{
$invoices = Invoice::with('contact')->collect(['invoice_number'=> 'desc']);
$invoices = Invoice::with(['contact', 'transactions'])->collect(['invoice_number'=> 'desc']);
$customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id');

View File

@ -30,7 +30,7 @@ class Revenues extends Controller
*/
public function index()
{
$revenues = Transaction::with(['account', 'category', 'contact'])->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');