Skip to content

Commit 3529d55

Browse files
committed
fix: Issue with not defined after optimization.
the problem is related to laravel caching cannot see env() method after caching
1 parent 6488f35 commit 3529d55

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/Services/GitHubService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ public static function fetchReadmeContent(string $repoUrl): ?string
5555

5656
$apiUrl = "https://api.github.com/repos/{$owner}/{$repo}/readme";
5757

58+
$token = config('services.github.token');
59+
5860
$response = Http::withHeaders([
5961
'Accept' => 'application/vnd.github.v3+json',
60-
'Authorization' => 'Bearer '.env('GHUB_TOKEN'),
62+
'Authorization' => 'Bearer '.$token,
6163
])->get($apiUrl);
6264

6365
if ($response->failed()) {

config/services.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
3939
'client_id' => env('GHUB_ID'),
4040
'client_secret' => env('GHUB_SECRET'),
4141
'redirect' => env('GHUB_URL'),
42+
'token' => env('GHUB_TOKEN'),
4243
],
4344
];

0 commit comments

Comments
 (0)