Answer the question
In order to leave comments, you need to log in
Where to take out the logic for saving the file loaded through the form?
Hello! Where is the best place to put the logic for processing and saving the uploaded file through the form?
At the moment I'm considering 3 options:
1. Create a base controller and inherit from it.
2. Move to a trait.
3. Transfer to a separate class and work with it.
4. Your option...
In short, what will be the logic: creating a path (with checking if there is already such a file) along which the file will be saved, and actually saving the file itself request()->file('file')->storeAs(...)
. Perhaps something else will be added, for example, setting a disk for saving.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question