Closed kamrangaravaliyev closed 2 years ago
@kamrangaravaliyev Hi,
What is your nova version?
Nova version 3
@kamrangaravaliyev May I know what version of the tab package you have installed?
Do you mean this SimpleRepeatable package? https://packagist.org/packages/optimistdigital/nova-simple-repeatable
Can you send an example of your code using these 2 packages?
yes. Laravel Nova version. 3.32.0 "outl1ne/nova-simple-repeatable": "1.4.3", "kongulov/nova-tab-translatable": "^1.1",
@kamrangaravaliyev
I don't see any problem with myself. Could you send me an example of your code so that I can simulate the error you made?
SimpleRepeatable::make('Days', 'days', [ NovaTabTranslatable::make([ Text::make("Name", 'name')->rules('required_lang:az'), Trix::make("Description")->rules('required_lang:az') ]), ])->addRowLabel("Gün əlavə et")
This is the code. Unfortunately it doesn't work
@kamrangaravaliyev
The "NovaTabTranslatable" package works together with the "spatie/laravel-translatable" package where you must specify the "name" field in the model with the translatable $translatable=['name']; But such a structure will not work with the "SimpleRepeatable" package, so wrapping the "NovaTabTranslatable" package in "SimpleRepeatable" will not work.
But if you wrap "SimpleRepeatable" in "NovaTabTranslatable" then everything will work
NovaTabTranslatable::make([
SimpleRepeatable::make('Name', 'name', [
Text::make('Name1'),
Text::make('Name2'),
])
->canAddRows(true) // Optional, true by default
->canDeleteRows(true), // Optional, true by default
])
Hi, I tried to use it with SimpleRepeatable. i am getting error. Kongulov\NovaTabTranslatable\NovaTabTranslatable::Kongulov\NovaTabTranslatable{closure}(): Argument #2 ($model) must be of type Illuminate\Database\Eloquent\Model, null given {"userId":1,"exception":" [object] (TypeError(code: 0): Kongulov\NovaTabTranslatable\NovaTabTranslatable::Kongulov\NovaTabTranslatable\{closure}(): Argument #2 ($model) must be of type Illuminate\Database\Eloquent \Model, null given at /var/www/vendor/kongulov/nova-tab-translatable/src/NovaTabTranslatable.php:118)