title: How to capture login hours upon logout in Laravel?
body: <p>I am making an application with Laravel 5 and I should have a module to save and update the login hours of a user.</p>
  
  <p>I'm new to programming so I'm going nuts to the logic to how to do it.</p>
  
  <p>This is for call center agents, Their shift is between <code>3pm to 6am</code> So for example they login with a timestamp of <code>2015-07-21 03:00:00</code> that's <code>3pm</code> then if they logout at <code>4pm</code> they have <code>1.0</code> of login hours then they login again at <code>7pm</code> and log out at <code>5am of 2015-07-21</code> then that will be their previous login hour which is <code>1.0</code> + <code>10.0</code> because of <code>7pm 2015-07-20 - 5am 2015-07-21</code>. And should update the loginhours of that user.</p>
  
  <p>How can I do this? So now I have a table in my database which is </p>
  
  <pre><code>logihours
   -&gt;id
   -&gt;user_id
   -&gt;loginhours (double/float)
   -&gt;timestamp (timestamp of last login/logout)
   -&gt;status (if currently logged in or logged out
  </code></pre>
  
  <p>That is I have now, for sure do this I need to always check in my <code>login</code> and <code>logout</code> functions but I don't know where to start.</p>