First of all, when you do this:
$checkertimeout = Attendance
::where('emp_id', $request->emp_id)
->where('attend_date', $date)
->get(['time_out']); // <---
You are getting a Collection of all the time_out fields of every Attendance models that match your criteria (the wheres). This means, something like this:
=> Illuminate\Database\Eloquent\Collection {#3323
all: [
App\Attendance {#3332
attend_date: "2019-10-06 22:01:29",
},
App\Attendance {#3340
attend_date: "2019-10-06 22:01:29",
},
App\Attendance {#314
attend_date: null,
},
],
}
You can get more info in the Eloquent section of the documentation.
Now, if your query is designed to get only one record, you could use the ->first() method instead of the get() one. This method will return the first Attendance object that matches your criteria.
$checkertimeout = Attendance
::where('emp_id', $request->emp_id)
->where('attend_date', $date)
->first(); // <---
PS: If you only need to retrieve the time_out value, you could also add the ->select('attend_date') to the query:
$checkertimeout = Attendance
->select('time_out'); // <---
::where('emp_id', $request->emp_id)
->where('attend_date', $date)
->first(); // <---
With these clarifications, let's go to your question. If you want to check if a field is null.. you could just make use of the PHP function is_null().
Using the collection
$checkertimeout = Attendance
::where('emp_id', $request->emp_id)
->where('attend_date', $date)
->get(['time_out']);
if(is_null($checkertimeout->first()->time_out))
{
// ...
}
Using a single object
$checkertimeout = Attendance
->select('time_out'); // <---
::where('emp_id', $request->emp_id)
->where('attend_date', $date)
->first(); // <---
if(is_null($checkertimeout->time_out)) // <----
{
// ...
}
Side note
As a side note, if you want to avoid the null results for that value, you could add another contraint in your query:
$checkertimeout = Attendance
::where('emp_id', $request->emp_id)
->where('attend_date', $date)
->whereNotNull('time_out') // <-----
->get(['time_out']);