On Custom page after uploading image, preview is not showing after refreshing.
Give me a exact solution to preview image on custom page.
Solution:Jump to solution
I just checked the docs. Did you read this part of the docs? Because you are missing
->model()
https://filamentphp.com/plugins/filament-spatie-media-library#form-component...Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
24 Replies
"Preview is not showing" and you share a "screenshot" that shows the preview? 🤔
Filament
Why are my file previews not loading? by Dan Harrin - Filament
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
This is not preview
after refreshing the page it is not showing preview
So why are you adding an unrelated image?
Check the link I shared above. Very likely a wrong setup
after save and then refreshing the page, company name and all is showing except logo
I have tried that given solution but there is no preview.
Did you check the DevTools console? Any errors?
That's an editor. DevTools are the thing in your browser.
Please learn what the Browser DevTools are. Also learn how to take screenshots 🙈
actually, i am doing this for custom page not for resources.
Okay. And now check the "Console" tab. Not elements.
its not showing anything
Can you share the code for this page? Please check #✅┊rules on code formatting if you haven't
wait
I am using Spatie Media library
public function save(): void
{
try {
$data = $this->form->getState(); filament()->auth()->user()->update($data); Notification::make() ->title('Company Details Saved!') ->success() ->send(); } catch (Halt $exception) { return; } }
$data = $this->form->getState(); filament()->auth()->user()->update($data); Notification::make() ->title('Company Details Saved!') ->success() ->send(); } catch (Halt $exception) { return; } }
I see you are using S3. Are you sure there aren't any errors in console tab?
yes no error
Did you set up CORS?
actually file is stored in database
just need to preview it
Can you please share a screenshot of the page with the DevTools console open?
Solution
I just checked the docs. Did you read this part of the docs? Because you are missing
->model()
https://filamentphp.com/plugins/filament-spatie-media-library#form-componentFilament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
thanks issue resolved👍