Skip to content

Commit

Permalink
feat: add nofuzy api
Browse files Browse the repository at this point in the history
  • Loading branch information
alihardan committed May 20, 2024
1 parent b168e70 commit cbe2cf8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/Http/Controllers/PublicApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,14 @@ public function lostGames()
{
return str_replace("lost-games/", "", Storage::disk('public')->files('lost-games'));
}

public function nofuzy1()
{
header("Content-type: text/csv");
$games = Game::with(['producers:slug,title_fa,title_en', 'publishers:slug,title_fa,title_en'])->latest()->get();
echo "id,tilte_en,title_fa,publisher\n";
$games->each(function ($game) {
echo $game->id . "," . ($game->title_en ?? $game->games[0]['title_en'][0] ?? '') . "," . ($game->title_fa ?? $game->games[0]['title_fa'][0] ?? '') . "," . $game->publishers[0]->title_fa[0] ?? '' . "\n";
});
}
}

0 comments on commit cbe2cf8

Please sign in to comment.