You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
``Collection is returning all translations and I don't know how to filter it using laravel-translatable.
I have tried using translation('en'), translatedIn('en') methods and they don't work.
This is JSON repsonse of collection:
{
"meta": {
"current_page": 1,
"data": [
{
"id": 1,
"category_id": null,
"status": "created",
"created_at": "2022-04-23T19:52:55.000000Z",
"updated_at": "2022-04-23T19:52:55.000000Z",
"deleted_at": null,
"meal_name": "Omelette",
"translations": [
{
"id": 4,
"meal_id": 1,
"locale": "de",
"meal_name": "Omelette",
"slug": "omelette",
"description": "Gefalteter Pfannkuchen aus geschlagenen Eiern, manchmal mit der Zugabe von Gemüse, Käse oder Fleisch."
},
{
"id": 1,
"meal_id": 1,
"locale": "en",
"meal_name": "Omelette",
"slug": "omelette",
"description": "Folded pancake made of beaten eggs, sometimes with the addition of vegetables, cheese, or meat."
},
{
"id": 2,
"meal_id": 1,
"locale": "fr",
"meal_name": "Omelette",
"slug": "omelette",
"description": "Crêpe pliée à base d'œufs battus, parfois avec l'ajout de légumes, de fromage ou de viande."
},
{
"id": 3,
"meal_id": 1,
"locale": "it",
"meal_name": "Frittata",
"slug": "frittata",
"description": "Frittella ripiegata a base di uova sbattute, a volte con l'aggiunta di verdure, formaggio o carne."
}
]
},
{
"id": 4,
"category_id": 2,
"status": "created",
"created_at": "2022-04-23T19:52:57.000000Z",
"updated_at": "2022-04-23T19:53:22.000000Z",
"deleted_at": null,
"meal_name": "Pasta bolognese",
"translations": [
{
"id": 16,
"meal_id": 4,
"locale": "de",
"meal_name": "Bolognese-Nudeln",
"slug": "bolognese-nudeln",
"description": "Spaghetti Bolognese besteht aus Spaghetti mit einem italienischen Ragù (Fleischsoße) aus Hackfleisch und Tomaten."
},
{
"id": 13,
"meal_id": 4,
"locale": "en",
"meal_name": "Pasta bolognese",
"slug": "pasta-bolognese",
"description": "Spaghetti bolognese consists of spaghetti with an Italian ragù (meat sauce) made with minced beef and tomatoes."
},
{
"id": 14,
"meal_id": 4,
"locale": "fr",
"meal_name": "Pâtes bolognaises",
"slug": "pates-bolognaises",
"description": "Les spaghettis à la bolognaise se composent de spaghettis avec un ragù italien (sauce à la viande) à base de bœuf haché et de tomates."
},
{
"id": 15,
"meal_id": 4,
"locale": "it",
"meal_name": "Pasta al ragù",
"slug": "pasta-al-ragu",
"description": "Gli spaghetti alla bolognese sono spaghetti al ragù italiano (sugo di carne) a base di carne macinata e pomodori."
}
]
}
],
"first_page_url": "http://127.0.0.1:8000/api/jela-svijeta?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://127.0.0.1:8000/api/jela-svijeta?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://127.0.0.1:8000/api/jela-svijeta?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://127.0.0.1:8000/api/jela-svijeta",
"per_page": 5,
"prev_page_url": null,
"to": 2,
"total": 2
}
}
How can I filter this collection to return just specified collection?
The text was updated successfully, but these errors were encountered:
``Collection is returning all translations and I don't know how to filter it using laravel-translatable.
I have tried using
translation('en'), translatedIn('en')
methods and they don't work.This is JSON repsonse of collection:
How can I filter this collection to return just specified collection?
The text was updated successfully, but these errors were encountered: