Skip to content

Commit

Permalink
adding activate and revoke method directly to model apiKey
Browse files Browse the repository at this point in the history
  • Loading branch information
metallurgical committed Mar 31, 2020
1 parent 30f2ea5 commit 412d154
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/ApiKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,32 @@ public function isActive()
{
return true === $this->status;
}

/**
* Activate the current key.
*
* @return $this
*/
public function activate()
{
$this->update([
'status' => true,
]);

return $this;
}

/**
* Revoke the current key.
*
* @return $this
*/
public function revoke()
{
$this->update([
'status' => false,
]);

return $this;
}
}

0 comments on commit 412d154

Please sign in to comment.