- Added
getCatalogueLocales
to get all available locales for a model.
- Added
initializeHasI18n
method to add catalogueItems
relation to $with
and $hidden
array when booting new model.
- Fixed an issue when translating models which are not persisted in database yet. Now you can ask, set and remove translations also when the model
does not exist.
$instance = new Model;
$instance->title = 'Translated title';
$instance->save();
- Fixed an issue when assigning array with translations to catalogue attributes.
$instance = new Model;
$instance->title = [
'en' => 'English title',
'it' => 'Italian title',
];
$instance->save();
- Added API to create models with catalogue items using
Model::create
static method.
$instance = Model::create([
'title' => [
'en' => 'English title',
'it' => 'Titolo italiano',
],
'order' => 1,
]);
- Update README.md file documentation.