title: Check the existed record but the record is existed in database and return false result when dd()
body: <p>I am having a problem that the record I want to check if that day we have already check in or not. If we check on that day and no scan_in_time, should return false, otherwise it returns already check in. </p>
  
  <p>This is my code below when I write to check if the check_in attendance is existed or not using attendance_date and scan_in_time</p>
  
  <pre><code>public function checkinExists(){
        $check_attendance = Attendance::whereDay('attendance_date', request('day'))
            -&gt;whereMonth('attendance_date', request('moth'))
            -&gt;whereYear('attendance_date', request('year'))
            -&gt;whereNotNull('scan_in_time')
            -&gt;where('user_id', auth()-&gt;user()-&gt;user_id)
            -&gt;exists();
          dd($check_attendance);
        if(!$check_attendance){
          return response()-&gt;json(
            [
              'message' =&gt; 'No checkin'
            ]
          );
        }else{
          return response()-&gt;json(
            [
              'message' =&gt; 'Checked in'
            ]
          );
        }
      }
  </code></pre>
  
  <p>When I use dd($check_attendance) and POSTMAN return false, but the record is existed in database. How can I improve the code in here, thanks a lot.</p>