shariff
1 month ago
306
2
Laravel

get_class() expects parameter 1 to be object, null given (Yajra Datatable)

Posted 1 month ago by shariff

HI,

When I am retrieving data using yajra datatable I am getting an error like below. Same code for other things it's working. I don't know what is wrong with the below code. Please help me.

exception: "ErrorException"
file: "C:\xampp\htdocs\usermanagement\vendor\yajra\laravel-datatables-oracle\src\DataTables.php"
line: 63
message: "get_class() expects parameter 1 to be object, null given"

controller

 public function index(Request $request)
    {

        $data = Lead::find($request->leadid)->notes;

        return Datatables::of($data)
        ->addColumn('actions','lead.notebutton')
        ->rawColumns(['actions'])
        ->addIndexColumn()
        ->make(true);


    }

thank you

Please sign in or create an account to participate in this conversation.