I believe you have to append () to it like this:
$supplierVouchers = Supplier::where('suppliercode', $suppliercode)->vouchers()->get();
Or using with:
$supplierVouchers = Supplier::where('suppliercode', '=', $suppliercode)->with('vouchers')->get();
Unfortunatley did the first solution end in the same error message, but the second did work as intended :-) Thank you very much.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community