/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $visitors = Visitor::whereNull('punch_out')->orderBy('punch_in', 'DESC')->get(); $recents = Visitor::whereNotNull('punch_out')->orderBy('punch_out', 'DESC')->get(); return view('visitors.index', compact('visitors', 'recents')); }