Questions tagged [laravel-translatable]

A Laravel package for translating database contents.

Laravel-Translatable is a localization package for and .

35 questions
0
votes
1 answer

How to pass locale parameter from job into controller?

On laravel site making Http Post request inside of job handle I need to pass locale parameter. And this locale must be used in controller. I use astrotomic/laravel-translatable and defined in config/translatable.php with default 'en' : 'locales' =>…
Petro Gromovo
  • 1,755
  • 5
  • 33
  • 91
0
votes
1 answer

Why data returned with astrotomic/laravel-translatable have invalid language?

On laravel 9 site I added astrotomic/laravel-translatable and getting set of data I see a bit different results I expected As I have 2 languages defined in config/translatable.php with default 'en' : 'locales' => [ 'en', 'fr', ... …
Petro Gromovo
  • 1,755
  • 5
  • 33
  • 91
0
votes
0 answers

Transform all repeatable fileds into array - laravel backpack (fake fields)

I'm using Laravel Backpack within Spatie Laravel Translatable. I want to pass some translatable fields into the front but I've some issues. I have a field named "extras" which is used by the backpack to store repeatable fields (I need this field to…
0
votes
0 answers

How to call a static Method in Laravel Translatable package on per model basis

I am using this package for managing translations in a Laravel project. The resulting output of an API endpoint is as shown in the image with translation array. In there documentation (link:…
abhiklpm
  • 1,603
  • 2
  • 16
  • 21
0
votes
1 answer

Laravel Translation Still `en` even if locale changed

i'm trying to change language with laravel but it still en (fallback_locale) locale changes successfully to another language but laravel still depends on fallback_locale while changing fallback locale to 'ar' as example, blade prints the key as…
0
votes
2 answers

laravel-translatable: converting existing text column to translatable

i'm trying to convert and existing text column to translatable. I find that when i add the column name to the the protected translatable array i am no longer able to access it as i did before ($model->key) I assume that this is because its looked…
Ben Kemp
  • 1,501
  • 2
  • 7
  • 9
0
votes
1 answer

Laravel astrotomic translatable update method

I tried to update a record with this code but no success, i have this error message ... this is probably not the right method public function update(Request $request, int $id) { // dd($id, $request); $article_data = array(); …
Arnauld
  • 1
  • 1
0
votes
1 answer

Can't update a translatable model in Laravel

I am using https://github.com/Astrotomic/laravel-translatable to make my models translatable. While I am trying to update the model using below method to update the mode along with its associated translated content. $product =…
ahmedsaber111
  • 821
  • 5
  • 19
  • 38
0
votes
1 answer

How can I make localized a non-localized model in Larvel Backpack?

I have a non-localized model: Article with the following properties: id, title, description; and I want to localize title and description. I have seen in the Laravel Backpack documentation that CRUDs can manage localized models using…
0
votes
2 answers

Laravel Spatie translation package not working for Raw Queries and join operations

Used this Spatie/laravel-translatable package i achived my localization with ORM queries like (Article::all();). But when i use raw query or join operations(DB queries), it shows the raw json from database. Article.php
Manoj R
  • 3
  • 5
0
votes
0 answers

How to send id using locale prefix in laravel 7

Currently, I am using spatie/laravel-translatable package and for slug cviebrock/eloquent-sluggable, but when I want to go specific post I mean when clicking "read more" button of post it is going to page not found. Here is my…
0
votes
1 answer

Laravel translatable won't let me get my original data

I'm using a package called dimsav/laravel-translatable to provide translations for some columns in a table I have. The table called Articles and has the following fields: ID, Title, Body, Picture, user_id and I'm using the package…
marmahan
  • 183
  • 2
  • 15
0
votes
2 answers

Laravel 6 groupBy to belongsTo relationship

Hello I have Post model with relation: public function category() { return $this->belongsTo(category::class); } I need show posts on every tab of category. For this I need use groupBy. When I do this: $posts =…
Mafys Grif
  • 557
  • 3
  • 13
  • 30
0
votes
2 answers

Call to a member function hasTranslation() on null - Laravel

I am using Laravel Translatables. But when I execute I got an error like Call to a member function hasTranslation() on null. Here is my code. product->hasTranslation($locale)) { $type =…
geeth
  • 704
  • 2
  • 14
  • 42
0
votes
1 answer

spatie/laravel-translatable 5.6 cannot translate slug and throws 404

I have 'courses' table in my database and JSON 'slug' column in it. For example: | Slug | |------------------------------------------------------| | {"az": "slug-in-azerbaijani", "ru":…