Solved it myself by adding $id to the $economic->invoiceBusiness();
and by adding
use Illuminate\Database\Eloquent\Model;
use \stdClass;
to the economic class and then moving the below to the economic class.
$servicecase = Servicecase::find($id);
$account = Servicecase::find($id)->account;
$parts = Servicecasepart::where('servicecase_id', '=', $id)->get();
$sum = Servicecasepart::where('servicecase_id', '=', $id)->sum('line_total');
Works like a charm now :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community