Support the ongoing development of Laravel.io →
posted 8 years ago
Eloquent
Last updated 2 years ago.
0

I believe you have to append () to it like this:

$supplierVouchers = Supplier::where('suppliercode', $suppliercode)->vouchers()->get();
Last updated 8 years ago.
0

Or using with:

$supplierVouchers = Supplier::where('suppliercode', '=', $suppliercode)->with('vouchers')->get();

0

Unfortunatley did the first solution end in the same error message, but the second did work as intended :-) Thank you very much.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

JasminSky jasminsky Joined 25 Apr 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.