spatie / laravel-settings

Store strongly typed application settings
MIT License
1.2k stars 109 forks source link

Question how to setup laravel-settings with laravel-translatable #281

Closed hydraneo closed 1 month ago

hydraneo commented 1 month ago

Their is a way to do this?

hydraneo commented 1 month ago

gettting working using chatgpt :)

`class GeneralSettings extends Settings { use HasTranslations;

public string $site_name; 

public static function group(): string
{
    return "general";
}

protected $translatable = ["site_name"]

}`

gcorp-llc commented 1 month ago

thank you But this method does not work 1 - use HasTranslations; must be written in the model and does not work in the GeneralSettings class 2- The new data stored by Laravel Translate is a presentation, not a string public string $site_name;

3- Don't trust GPT chat too much, it may help a junior who happens to be a part of the code, and in many cases it does not provide reliable code, and time should be spent to fix and debug the code.

And thanks for your help

hydraneo commented 1 month ago

Yes correct did not work. Thank you for the feedback.