mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-15 11:07:53 -04:00
19 lines
406 B
PHP
19 lines
406 B
PHP
<?php
|
|
|
|
namespace Modules\StudioPlus\Services;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
class HandleAuthToken
|
|
{
|
|
public function generateToken()
|
|
{
|
|
$user = User::where('id', auth()->id())->first();
|
|
|
|
$token = $user->createToken('my_token')->plainTextToken;
|
|
$token = explode('|', $token)[1];
|
|
Cache::put('authToken', $token);
|
|
}
|
|
}
|