On Custom page after uploading image, preview is not showing after refreshing.

Give me a exact solution to preview image on custom page.
No description
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.
No description
Jump to solution
24 Replies
Dennis Koch
Dennis Koch5mo ago
"Preview is not showing" and you share a "screenshot" that shows the preview? 🤔
Filament
Filament5mo ago
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.
Aditya Patil
Aditya Patil5mo ago
This is not preview after refreshing the page it is not showing preview
Dennis Koch
Dennis Koch5mo ago
So why are you adding an unrelated image? Check the link I shared above. Very likely a wrong setup
Aditya Patil
Aditya Patil5mo ago
No description
Aditya Patil
Aditya Patil5mo ago
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.
Dennis Koch
Dennis Koch5mo ago
Did you check the DevTools console? Any errors?
Aditya Patil
Aditya Patil5mo ago
No description
Dennis Koch
Dennis Koch5mo ago
That's an editor. DevTools are the thing in your browser. Please learn what the Browser DevTools are. Also learn how to take screenshots 🙈
Aditya Patil
Aditya Patil5mo ago
No description
Aditya Patil
Aditya Patil5mo ago
actually, i am doing this for custom page not for resources.
Dennis Koch
Dennis Koch5mo ago
Okay. And now check the "Console" tab. Not elements.
Aditya Patil
Aditya Patil5mo ago
its not showing anything
Dennis Koch
Dennis Koch5mo ago
Can you share the code for this page? Please check #✅┊rules on code formatting if you haven't
Aditya Patil
Aditya Patil5mo ago
wait I am using Spatie Media library
Aditya Patil
Aditya Patil5mo ago
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; } }
Dennis Koch
Dennis Koch5mo ago
I see you are using S3. Are you sure there aren't any errors in console tab?
Aditya Patil
Aditya Patil5mo ago
yes no error
Dennis Koch
Dennis Koch5mo ago
Did you set up CORS?
Aditya Patil
Aditya Patil5mo ago
actually file is stored in database just need to preview it
Dennis Koch
Dennis Koch5mo ago
Can you please share a screenshot of the page with the DevTools console open?
Aditya Patil
Aditya Patil5mo ago
No description
Solution
Dennis Koch
Dennis Koch5mo ago
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.
No description
Aditya Patil
Aditya Patil5mo ago
thanks issue resolved👍