-
app/Services/IssueService.php
Open in GitHubuse Illuminate\Support\Collection; class IssueService { // public function getAll(): Collection { return app(RepoService::class)->reposToCrawl() ->flatMap(fn (array $repo): array => $this->getIssuesForRepo($repo)); } // }
-
app/Services/RepoService.php
Open in GitHubuse Illuminate\Support\Collection; class RepoService { public function reposToCrawl(): Collection { return collect(config('repos.repos')) ->flatMap(function (array $repoNames, string $owner): array { return collect($repoNames)->map(function (string $repoName) use ($owner): array { return [ 'owner' => $owner, 'name' => $repoName, ]; })->all(); }); } }
-
app/Console/Commands/PreloadRepoData.php
Open in GitHubuse App\Services\IssueService; use Illuminate\Console\Command; class PreloadRepoData extends Command { // public function handle(): int { // $issues = app(IssueService::class)->getAll(); // } }