Skip to content

aanyszek/translations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

translations

instalation

add to "\config\app.php":

'providers' => [
    ...
    Bunta\Translations\TranslationsServiceProvider::class
    ...
],

add to "\app\SomeModel.php":

...
use \Bunta\Translations\TranslationsTrait;
...
public $translatedAttributes = ['nameVirtualAttributeToTranslate'];
...

run comands

composer du
php artisan optimize 
php artisan vendor:publish
php artisan migrate

Usage

Access to right translate

$model->nameVirtualAttributeToTranslate; 

Access to all translates

@foreach(Config::get('translations.locales') as $lang)
    {!! Form::text("nameVirtualAttributeToTranslate[$lang]",$model->translation('nameVirtualAttributeToTranslate',$lang)) !!}
@endforeach 

save translate

 Model::create($request->all());

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages