The Rise of Contactless Payments:...
In recent years, contactless payments have surged in popularity, driven...
<?php
namespace Laravel\Passport;
class RefreshTokenRepository
{
/**
* Creates a new refresh token.
*
* @param array $attributes
* @return \Laravel\Passport\RefreshToken
*/
public function create($attributes)
{
return Passport::refreshToken()->create($attributes);
}
/**
* Gets a refresh token by the given ID.
*
* @param string $id
* @return \Laravel\Passport\RefreshToken
*/
public function find($id)
{
return Passport::refreshToken()->where('id', $id)->first();
}
/**
* Stores the given token instance.
*
* @param \Laravel\Passport\RefreshToken $token
* @return void
*/
public function save(RefreshToken $token)
{
$token->save();
}
/**
* Revokes the refresh token.
*
* @param string $id
* @return mixed
*/
public function revokeRefreshToken($id)
{
return Passport::refreshToken()->where('id', $id)->update(['revoked' => true]);
}
/**
* Revokes refresh tokens by access token id.
*
* @param string $tokenId
* @return void
*/
public function revokeRefreshTokensByAccessTokenId($tokenId)
{
Passport::refreshToken()->where('access_token_id', $tokenId)->update(['revoked' => true]);
}
/**
* Checks if the refresh token has been revoked.
*
* @param string $id
* @return bool
*/
public function isRefreshTokenRevoked($id)
{
if ($token = $this->find($id)) {
return $token->revoked;
}
return true;
}
}
Blog Section
Dive into our blog to explore the cutting-edge trends in digital payments and NFC technology. Stay updated on the innovations that are revolutionizing transactions, boosting security, and making payments quicker and more convenient. Learn how these advancements are shaping the future of financial interactions and driving the global transition towards a cashless world.
In recent years, contactless payments have surged in popularity, driven...
As digital transactions proliferate, ensuring robust payment security is more critical than ever. Two foundational...
Digital wallets have fundamentally transformed how we manage money, offering a streamlined, secure, and highly...