We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello! I want to get all categories by locale. I try to
$categories = BinshopsCategoryTranslation::whereHas('language', function($q){ $q->where('locale', app()->getLocale()); })->get();
And get error
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'binshops_languages.lang_id' in 'where clause'
When i change a relation language on model BinshopsCategoryTranslation to
public function language() { return $this->hasOne(BinshopsLanguage::class,"id","lang_id"); }
Then i get collection of Categories with name by current locale.
dd($categories[0]->category_name); // Show name
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello! I want to get all categories by locale. I try to
And get error
When i change a relation language on model BinshopsCategoryTranslation to
Then i get collection of Categories with name by current locale.
The text was updated successfully, but these errors were encountered: