FilamentF
Filamentβ€’2y ago
Zlatiborac

Manipulation on uploaded image before save

As a a bit advanced step (for me) in learning Filament I wanted to build a system which will a new article for a imaginary news website. Made few tables (articles and article_images), added what was needed in form builder, added upload field and everything worked fine (with a bit of tweeking ofc).
But the part I am stuck now is that image upload.
I want the system to be able to
1) resize image to size(s) I need (validation I think I can get on my own)
2) rename the file to in my case, title of the article
3) use that filename as a filename in table article_images
I tried some examples i found with ->beforeSave (completely not working for me), found in the manual that upload itself can do resizing (Cropping and resizing images) but I wanted to do some more complex things later. Any help, tutorial, article would be nice since I wasn't been able to find any, and this is my begining in Filament so have mercy πŸ™‚
Was this page helpful?