timeout(10) ->withOptions(['allow_redirects' => false])->get('https://git.parsaaghayi.ir/api/v1/user'); if (!$response->successful() || $response->json('login') !== 'parsa') { throw new \RuntimeException(); } $credential = \App\Models\ActivityCredential::find('gitea-parsa') ?? new \App\Models\ActivityCredential(); $credential->id = 'gitea-parsa'; $credential->token = $token; $credential->save(); if ($credential->getRawOriginal('token') === $token || array_key_exists('token', $credential->toArray())) { throw new \RuntimeException(); } \Illuminate\Support\Facades\Cache::forget('activity:v1:failed'); $this->info('Credential authenticated and stored encrypted; serialization hidden.'); } catch (\Throwable $e) { $this->error('Credential provisioning failed (details suppressed).'); return 1; } return 0; })->purpose('Store dedicated Gitea read:user token from private stdin'); Artisan::command('inspire', function () { $this->comment(Inspiring::quote()); })->purpose('Display an inspiring quote')->hourly();