From c9a6ffb9452dc3e3e19f70ee9d49f011af2c09e3 Mon Sep 17 00:00:00 2001 From: alihardan Date: Mon, 20 May 2024 05:07:43 +0330 Subject: [PATCH] fix(nofuzy-api): fix error --- app/Http/Controllers/PublicApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 84eefa5..9b421a3 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -99,7 +99,7 @@ public function nofuzy1() $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"; + echo $game->id . "," . ($game->title_en ?? $game->games[0]['title_en'][0] ?? '') . "," . ($game->title_fa ?? $game->games[0]['title_fa'][0] ?? '') . "," . ($game->publishers->first()?->title_fa[0] ?? '') . "\n"; }); } }