#!/bin/bash
cd /var/www/html
php artisan tinker --execute "
\$token = App\Models\ApiToken::create([
'name' => 'ai-test-token',
'token' => 'ai-test-' . bin2hex(random_bytes(16)),
'owner_type' => 'user',
'owner_identifier' => 'rbsetiawan',
'scopes' => json_encode(['admin']),
]);
echo 'TOKEN=' . \$token->token . PHP_EOL;
" 2>&1 | grep -v Deprecated | grep TOKEN