Call to a member function getAttributeValue() on null Using Spatie Media & Translatable Plugins
when added Media & Translatable Plugins in the Resource i get error when try to upload and save the image
18 Replies
Share some code and the error url. Please read #✅┊rules
GitHub
GitHub - PterodactylStore/filament-test
Contribute to PterodactylStore/filament-test development by creating an account on GitHub.
Any solution?
Hm. I don’t know sorry
Can you share the flare url?
What's flare url
GitHub
Call to a member function getAttributeValue() on null Using Spatie ...
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 Recording.2023-08-20.0...
Flare is Laravels error screen and you can hit the share button there. See #✅┊rules
Flare
Call to a member function getAttributeValue() on null - The error occurred at http://127.0.0.1:8001/admin/posts/1/edit
Help?
For some reason the media object is null like it’s not getting attached to the record. Did you follow all the steps for spatie media library itself (not the plugin) to setup your model?
Yes
I think because I'm using spatie translatable
I try without translatable plugin and it's work
And this error appear only if I use spatie media library and translatable both in same resource
I have also included my repo that reproduce the error
https://github.com/PterodactylStore/filament-test/blob/main/app/Models/Post.php
The post model is correct following the docs for both packages
GitHub
filament-test/app/Models/Post.php at main · PterodactylStore/filame...
Contribute to PterodactylStore/filament-test development by creating an account on GitHub.
any idea how i can combine both spatie plugins without the mentioned error ?
I honestly don’t know. I’d recommend reaching out on one of the Spatie packages repos to see what they recommend for having them work together.
I have already try to add image manually to database for each translatable post and display the post with images
And is works
So the problem filament plugin can't Handel adding the media image to database when translatable plugin is enabled
There is a bug in the Translatable Plugin. You can follow it at https://github.com/filamentphp/filament/issues/7591
GitHub
Translatable resource with media bug · Issue #7591 · filamentphp/fi...
Package filament/spatie-laravel-translatable-plugin Package Version v3.0.13 Laravel Version v10.18.0 Livewire Version v3.0.0-beta.8 PHP Version PHP 8.2.8 Problem description Editing translatable re...
Okay thank you 👍