query('locale', 'fa'); $categories = ProjectCategory::query()->get(); return response()->json([ 'data' => $categories->map(function (ProjectCategory $category) use ($locale) { return [ 'id' => $category->id, 'title' => $category->getTranslation('title', $locale), 'description' => $category->getTranslation('description', $locale), 'image' => $category->image, ]; }), ]); } }