title: Laravel 5 How to check password reset token if it has expired or not
body: <p>I'm developing a web app using Laravel 5, I used Laravel's <code>make:auth</code> scaffolding. I was able to send a password reset link with a token, which works well on my end. I have this kind of url after clicking on the reset link: <em><code>http://example.com/password/reset/{reset_token}</code></em>.
   Now, on my <code>auth.reset</code> blade file, I want to check first if the <code>{reset_token}</code> has already expired because it seems in the 60 minutes expiration time at <strong><code>config.auth.php</code></strong>, it doesn't seem to automatically remove expired tokens. So, I'm trying to make a manual function to check if reset token is still valid with this:</p>
  
  <pre><code>function validateReminderToken($token)
  {
      // I want to add some filter here like
      // if (tokenExpired($token)) return false;     
      $res = DB::table('password_resets')-&gt;where('token', $token)-&gt;get();
      if (empty($res)  || $res === null) {
          return false;
      }
  
      $res = $res[0];
      return $res-&gt;email;
  }
  </code></pre>
  
  <p>How can I do it? Is there some built-in way of checking if the token has expired? Thanks.</p>