You've already forked pilot-sdk
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 264e0b72ba |
@@ -49,6 +49,23 @@ abstract class Action extends Entity
|
||||
];
|
||||
}
|
||||
|
||||
public function link($url, $expires = 5)
|
||||
{
|
||||
$key = 'pilot_action_' . Str::random(10);
|
||||
$token = Str::random(40);
|
||||
|
||||
cache()->add($key, $token, now()->addMinutes($expires));
|
||||
|
||||
$url = $url . (str_contains($url, '?') ? '&' : '?') . "pilot_token=$key|$token";
|
||||
|
||||
return [
|
||||
'json' => [
|
||||
'type' => 'link',
|
||||
'url' => $url,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function error($message)
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user