public scopeValidOrFail ( |
||
$query | ||
$id | string | |
return | static |
public function scopeValidOrFail($query, $id)
{
$token = $query->find($id);
if (!$token || $token->created_at < new DateTime('-1 day')) {
throw new InvalidConfirmationTokenException();
}
return $token;
}