Upload File to another table and get the id
hi, somebody can help me?
i'm stuck in file upload,
i have table file_storages and table technologies,
in file_storages table i have path column,
in technologies table i have tech_pic_id column,
so i stuck when create the technologies, and i don't know to create path in file_storages and get the foreign id and save it to tech_pic_id
![No description](https://cdn.answeroverflow.com/1315968391147946015/image.png)
4 Replies
see:
https://github.com/filamentphp/filament/discussions/11724
You need to use->saveUploadedFileUsing() and ->getUploadedFileUsing()
Though.. I just use spatie media instead
GitHub
File upload save to custom relationship · filamentphp filament · Di...
Package Panel builder Package Version 3 How can we help you? I am using the file upload component in a form but i have a model File (files table) which i need to setup as a relationship to other mo...
is that true sir?
![No description](https://cdn.answeroverflow.com/1315974493625385042/image.png)
Looks good
Would still recommend spatie media though
Then it handles everything you want automatically.
ok sir, thank you for the recommended and the answer 🙏