File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
resources/views/docs/desktop/1/getting-started Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,13 @@ public static function laravel(): static
29
29
30
30
public function latestVersion ()
31
31
{
32
- $ version = Cache::remember (
32
+ $ release = Cache::remember (
33
33
$ this ->getCacheKey ('latest-version ' ),
34
34
now ()->addHour (),
35
35
fn () => $ this ->fetchLatestVersion ()
36
36
);
37
37
38
- return $ version [ ' name ' ] ?? 'Unknown ' ;
38
+ return $ release ?-> name ?? 'Unknown ' ;
39
39
}
40
40
41
41
public function releases (): Collection
@@ -44,10 +44,10 @@ public function releases(): Collection
44
44
$ this ->getCacheKey ('releases ' ),
45
45
now ()->addHour (),
46
46
fn () => $ this ->fetchReleases ()
47
- );
47
+ ) ?? collect () ;
48
48
}
49
49
50
- private function fetchLatestVersion ()
50
+ private function fetchLatestVersion (): ? Release
51
51
{
52
52
// Make a request to GitHub
53
53
$ response = Http::get ('https://api.github.com/repos/ ' .$ this ->package .'/releases/latest ' );
@@ -57,7 +57,7 @@ private function fetchLatestVersion()
57
57
return null ;
58
58
}
59
59
60
- return $ response ->json ();
60
+ return new Release ( $ response ->json () );
61
61
}
62
62
63
63
private function getCacheKey (string $ string ): string
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ title: Release Notes
3
3
order : 1100
4
4
---
5
5
6
- @forelse (\App\Support\GitHub::electron()->releases() as $release)
6
+ @forelse (\App\Support\GitHub::electron()->releases()->take(10) as $release)
7
7
## {{ $release->name }}
8
8
** Released: {{ \Carbon\Carbon::parse($release->published_at)->format('F j, Y') }}**
9
9
You can’t perform that action at this time.
0 commit comments