Closed PterodactylStore closed 1 year ago
Same - Call to a member function getAttributeValue() on null
Closing this as it's a duplicate of #7591
first in the model you have to have the $translatable as
protected array $translatable = ['title', 'slug', 'description'];
also your migration must have all these fields as json:
Schema::create('porst', function (Blueprint $table) {
$table->id();
$table->json('title');
$table->json('slug');
$table->json('description');
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrentOnUpdate();
});
Finally make sure that you have the
use HasTranslations;
in the Post Model Class
I think this should solve the issue for you. I hope that this information helps.
Package
filament/spatie-laravel-media-library-plugin
Package Version
v3.0.27
Laravel Version
v10.18.0
Livewire Version
v3.0.0-beta.9
PHP Version
PHP 8.2.8
Problem description
https://github.com/filamentphp/filament/assets/133764150/9cdef2b9-1fc4-4a6d-ac67-114b2875c76b
Expected behavior
i have try it without Spatie Translatable Plugin and works good
but when i have enabled Translatable in PostResource im getting the error
Steps to reproduce
try yo upload image in Post Resource with Translatable plugin added to PostResource
Reproduction repository
https://github.com/PterodactylStore/filament-test
Relevant log output