Skip to content

Commit a077345

Browse files
authored
Merge pull request #3 from almirb/almirb-patch-withdata
Added withData() method
2 parents 479bc3a + 89e451c commit a077345

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/JWTTools.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ public function withModel(ActiveRecord $model, array $attributes = []): self
112112
return $this;
113113
}
114114

115+
public function withData($data = []): self
116+
{
117+
foreach($data as $k => $v){
118+
$this->payload->addExtraAttribute($k, $v);
119+
}
120+
return $this;
121+
}
122+
115123
public function getJWT(): string
116124
{
117125
try {

0 commit comments

Comments
 (0)