diff --git a/.env.example b/.env.example index 21e18924..6e39755a 100644 --- a/.env.example +++ b/.env.example @@ -74,7 +74,7 @@ MEDIA_DISK=media FILAMENT_FILESYSTEM_DISK=${MEDIA_DISK} SENTRY_LARAVEL_DSN= -SENTRY_TRACES_SAMPLE_RATE= +SENTRY_TRACES_SAMPLE_RATE=1.0 NOTCHPAY_PUBLIC_KEY= @@ -85,3 +85,5 @@ TWITTER_ACCESS_SECRET=your-access-token-secret GOOGLE_RECAPTCHA_SITE_KEY=your-recaptcha-site-key GOOGLE_RECAPTCHA_SECRET_KEY=your-secret-key + +GITHUB_FINE_GRAINED_TOKEN= diff --git a/app/Actions/GetGithubRepositoriesAction.php b/app/Actions/GetGithubRepositoriesAction.php new file mode 100644 index 00000000..fc998f50 --- /dev/null +++ b/app/Actions/GetGithubRepositoriesAction.php @@ -0,0 +1,38 @@ +get('https://api.github.com/orgs/laravelcm/repos'); + + if (Cache::has('github-repositories')) { + return Cache::get('github-repositories'); + } + + $only = [ + 'laravel-subscriptions', + 'livewire-slide-overs', + 'abstract-ip-geolocation', + 'angular-admin-panel', + ]; + + return Cache::remember( + key: 'github-repositories', + ttl: now()->addWeek(), + callback: fn () => collect($response->json()) + ->reject(fn (array $value) => $value['fork'] === true || ! in_array($value['name'], $only)) + ->map(fn (array $data) => RepositoryData::from($data)) + ); + } +} diff --git a/app/Data/RepositoryData.php b/app/Data/RepositoryData.php new file mode 100644 index 00000000..95fca545 --- /dev/null +++ b/app/Data/RepositoryData.php @@ -0,0 +1,18 @@ + env('GITHUB_CLIENT_ID'), 'client_secret' => env('GITHUB_CLIENT_SECRET'), 'redirect' => env('GITHUB_REDIRECT'), + 'token' => env('GITHUB_FINE_GRAINED_TOKEN'), 'scopes' => [], 'with' => [], ], diff --git a/lang/en/global.php b/lang/en/global.php index d4f1e92f..18c38618 100644 --- a/lang/en/global.php +++ b/lang/en/global.php @@ -103,5 +103,6 @@ 'characters' => ':number characters', 'like' => ':count like', 'locale_help' => 'The language in which your content will be available on the site.', + 'community_oss_description' => 'The community is also developing open source packages to contribute to the Laravel ecosystem.', ]; diff --git a/lang/fr/global.php b/lang/fr/global.php index b975b54b..fce43c37 100644 --- a/lang/fr/global.php +++ b/lang/fr/global.php @@ -103,5 +103,6 @@ 'characters' => ':number caractères', 'like' => ':count j\'aime', 'locale_help' => 'La langue dans laquelle votre contenu sera accessible sur le site.', + 'community_oss_description' => 'La communauté développe aussi des packages open source pour contribuer à l\'ecosystème de Laravel.', ]; diff --git a/resources/views/components/repository.blade.php b/resources/views/components/repository.blade.php new file mode 100644 index 00000000..9bdd01e7 --- /dev/null +++ b/resources/views/components/repository.blade.php @@ -0,0 +1,43 @@ +@props([ + 'repository', +]) + +
  • +
    +
    +

    +
    + + + + {{ $repository->name }} + + + + + +

    +

    + {{ $repository->description }} +

    +

    + + github.com +

    +
  • diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 319060db..68f61109 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -46,7 +46,7 @@ class="inline-flex items-center rounded-full bg-green-700 p-1 pr-2 text-white sm -
    +
    -
    +