add notifications logic and add support of both JWT and Sanctum
This commit is contained in:
@@ -2,15 +2,21 @@
|
||||
|
||||
namespace App\Libraries;
|
||||
|
||||
use App\Services\Staff\StaffTimeOffLinkService as StaffTimeOffLinkTokenService;
|
||||
|
||||
class StaffTimeOffLinkService
|
||||
{
|
||||
public function __construct(private StaffTimeOffLinkTokenService $service = new StaffTimeOffLinkTokenService())
|
||||
{
|
||||
}
|
||||
|
||||
public function createToken(array $payload): string
|
||||
{
|
||||
$json = json_encode($payload);
|
||||
if ($json === false) {
|
||||
return '';
|
||||
}
|
||||
return $this->service->createToken($payload);
|
||||
}
|
||||
|
||||
return rtrim(strtr(base64_encode($json), '+/', '-_'), '=');
|
||||
public function parseToken(?string $token): ?array
|
||||
{
|
||||
return $this->service->parseToken($token);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user