trevor
trevor
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
Thank you for the help 🙂
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
It actually ended up being something else entirely. I had a custom attribute in my Image model that would generate an asset string for the image path, and the ImageColumn in the table would take the asset and display the image, but the preview in the edit modal did not.
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
If that doesn't clear up my question though, no worries. I'll re-read the relationship docs again to see if I'm missing something 🙂
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
No description
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
So in the table generated by the Relation Manager, when I click edit on one of the RobotImages wouldn't that be a single record? It displays the alt_text in that edit modal which is another field on my RobotImages table.
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
No description
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
So a robot can have multiple images, and they are all listed out in a table on my robot resource. Let me know if that makes more sense
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
I have a Robot model which is a one to many relationship to my RobotImages table. The image on this form is just one instance of the RobotImages, so it should only be a single image.
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
This is in my Relation Manager class for the Images
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('alt_text')
->required()
->maxLength(255),
Forms\Components\FileUpload::make('image_path')
->image()
->label("Image")
]);
}
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('alt_text')
->required()
->maxLength(255),
Forms\Components\FileUpload::make('image_path')
->image()
->label("Image")
]);
}
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
So instead of an image directly on my Robot model, I have another table that it is pulling from and displaying in a table on my Robot resource
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
I do have something similar to this for an image directly on my model and that is working great. But I think my issue comes from the Realation Manager. I have a 'Robot' resource that can have multiple images. I've set that up in my ImagesRelationManager class in a similar manner to what you shown for your avatar.
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
Thats no problem, take your time 🙂
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
Thanks for the help by the way!
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
It looks like it is set correctly and I verified that the images show up correctly in my preview. Does the ImageUpload support previewing existing files on the model?
28 replies
FFilament
Created by trevor on 10/18/2023 in #❓┊help
Image upload preview
I'm using Laravel Herd so the APP_URL is http://domain.test and the preview of the image in the table works fine, but I will play with that to make sure it is what it should be.
28 replies