Skip to content
This repository was archived by the owner on Jun 18, 2019. It is now read-only.
This repository was archived by the owner on Jun 18, 2019. It is now read-only.

Disable translations for specific query #482

@rafailml

Description

@rafailml

Here is my case:
I have product which have a categories. When I edit the product I don't want to get translated categories. I want only category.id
How can I achieve that?

Here is what I'm doing now:

$product = Product::select('id', 'sku',...)
->with(['categories' => function ($query) {
                        $query->select(['categories.id']);
                    }])
->where('id', $id)
->first();

But I'm getting categories with their translations. Is it possible for that query only to get categories without translations?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions