Skip to content

Commit f0656e7

Browse files
✨ Refactor shared view variable registration for cleaner code and improved readability
1 parent c7d8015 commit f0656e7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/Providers/AppServiceProvider.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ public function boot(): void
2626

2727
private function registerSharedViewVariables(): void
2828
{
29-
if (app()->environment('production')) {
30-
View::share('electronGitHubVersion', GitHub::electron()->latestVersion());
31-
} else {
32-
View::share('electronGitHubVersion', 'dev');
33-
}
29+
View::share('electronGitHubVersion', app()->environment('production')
30+
? GitHub::electron()->latestVersion()
31+
: 'dev'
32+
);
3433
View::share('discordLink', 'https://discord.gg/X62tWNStZK');
3534
View::share('bskyLink', 'https://bsky.app/profile/nativephp.bsky.social');
3635
View::share('openCollectiveLink', 'https://opencollective.com/nativephp');

0 commit comments

Comments
 (0)