nevadskiy / laravel-translatable Goto Github PK
View Code? Open in Web Editor NEWTranslate your Eloquent models into different languages.
License: MIT License
Translate your Eloquent models into different languages.
License: MIT License
Replace class_uses
with class_uses_recursive
This package looks awesome, just wondering does this work with Laravel 8.x?
Does it work with Lumen took?
Save preloaded locales and lazy-load locales if current locale was not preloaded
Think about integration a separate table for storing locales and switch to locale_id field in translations table
Hello!
I'm installed your package!
Thank you so match!
It's very useful package.
I have an problem.
use Illuminate\Database\Eloquent\Model;
use UrlHelper;
use Croppa;
use Nevadskiy\Translatable\Strategies\SingleTableExtended\HasTranslations;
class OrderType extends Model
{
protected $translatable = [
'name',
'title',
'description',
'instruction',
'comment',
'youtube_video_id',
];
use HasTranslations;
}
I have an error
App\Models\OrderType::translator must return a relationship instance.
Dear @nevadskiy
Thank you for your package!
Amazing job!
I use it in my project, and it very useful for me!
I have an issue about supporting a hidden model option
My example is:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Nevadskiy\Translatable\Strategies\ExtraTableExtended\HasTranslations;
class OrderType extends Model
{
protected $translatable = [
'name',
'description',
];
protected $hidden = ['description'];
}
?>
A almost of times I don't need to have a description field in the json response.
But sometime I need it.
The first question is:
Can I change dynamically a $translatable attribute?
The second question is: is your package support a $hidden models attribute?
Add attributeTranslations(strinng $attribute, string $locale = null): Collection|Translation[]
method
When I change the locale with a package (mcamara/laravel-localization) the translated models are not showing.
dd(app()->getLocale())
outputs 'en'
Model is shown in the default (nl) language
If I add
app()->setLocale(app()->getLocale())
the correct language is shown (en)
Dear @nevadskiy
Thank you for your package!
Amazing job!
I use it in my project, and it very useful for me!
I have an issue about supporting a hidden model option
My example is:
`
`A almost of times I don't need to have a description field in the json response.
But sometime I need it.
The first question is:
Can I change dynamically a $translatable attribute?
The second question is: is your package support a $hidden models attribute?
Introduce orderByTranslatable('name')
method that allows to do alphabetical ordering using translation
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.