I am using Laravel orchid package and in layout file, I have this function:
protected function columns(): iterable
{
$org = '';
$employeeDetails = '';
return [
TD::make('Userid', __('User Id'))
->cantHide()
->sort()
->filter(Input::make()),
TD::make($employeeDetails, __('Employee Name'))
->filter(Input::make())
->render(function(DailyAttendance $attendance) {
$employeeDetails = Employee::where('employeeCode', $attendance->Userid)->first(['employeeName']);
return $employeeDetails;
})
->sort(),
];
}
The result is not picking employee name but whole with field name like this:
There are 2 tables one which is getting attendance logs based on userid and another table which is storing employee records like name and organizaion based on userid.
How can I only get the employee name using first or get.
I tried get('fieldname') but it is also returning the same result.