How to search nested relationship fields/column in Laravel and display nested relationship table/model

            $xxx = $this->xxxRepository
                ->whereHas('xxxTask', function ($query) use ($request) {
                    $query->where('xxx_id', '=', $request->xxx_id);
                })
                ->with(['xxxTask.nested_model_method'])
                ->orderBy('id', 'desc')
                ->findByField('aaa_id', $request->aaa_id);

Leave a Reply

Your email address will not be published. Required fields are marked *