Missing argument 1 for Illuminate\Database\Connection::table()
I am passing the argument here in the table function. I am getting this error on every function of the database which I am using.
It is working fine when I create the object of the model and then use the function table()
.
This is the code which I am using.
return DB::table('crop_growth')
->leftJoin('farmer_details', 'crop_growth.farmer_id', '=', 'farmer_details.id')
->select('crop_growth.id', 'crop_growth.remind_after', 'crop_growth.reason', 'crop_growth.is_read', 'farmer_details.name', 'farmer_details.phone')
->where('crop_growth.emp_id', $empId)
->where('crop_growth.remind_after', '!=', null)
->orderBy('crop_growth.is_read', 'ASC')
->orderBy('crop_growth.remind_after', 'ASC')
->get();