Upload multiple files to a separate table
Hello, i want to upload multiple files and assign them to the model but to save them in the separate database table. Ideally i prefer not to use other libraries like spatie media library to use the current db structure that i have. Any simple way to do this ?
1 Reply
Since you've already got an idea of the db structure required, you'll need to implement Laravel's relationships logic and simply tell your model where to store the related details upon save.
There'll be a few gotchas if you've never done that before, but that's the beauty of having other packages to take inspiration from.
Really, the simplest way to do what another package does is to study that package and implement its logic in your own app, skipping the features you don't require from it.
So, since that Spatie package has already solved a bunch of the problems you're trying to solve, explore how it works as you build your own version.
Or, pick another package that does it.
Related: https://discord.com/channels/883083792112300104/1189161951306199061/1189161951306199061