Backpack 5 for Laravel saves files into temporary folder of the webserver #538
-
I am using free version of Backpack 5 for Laravel as my admin panel. Also, I am using Laravel 10.13 and PHP 8.2.6. I have been trying to create a feature to add pictures for my blog posts however whenever I save the file it shows in my database following path: C:\wamp64\tmp\phpEF80.tmp However, I need my files to be saved in public/images/news. Please could you help me to solve this problem? I have googled and I could not find even a similar solution. Mainly people have problems with wrong directory, or they cannon open files, but it seems no one had probles with saving files into temporary directory of webserver. Restarting server and cleaning cache or running MIGRATION FILE
MODEL `
` CRUD CONTROLLER `
` FILESYSTEMS `
` Also, I tried to write simple debugging code in my modal in the method of setImageAttribute but it did not work at all, nothing was shown as output: `
` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
A mutator should have attribute name in the method name. In my case I called the mutator as setImageAttribute and my attribute name was main_picture_path so in order for everything to work flawlessly the mutator should be name as follows: setMainPicturePathAttribute. Nothing was said about it in the documentation and hours of hard work helped me to find out the solution. |
Beta Was this translation helpful? Give feedback.
A mutator should have attribute name in the method name. In my case I called the mutator as setImageAttribute and my attribute name was main_picture_path so in order for everything to work flawlessly the mutator should be name as follows: setMainPicturePathAttribute. Nothing was said about it in the documentation and hours of hard work helped me to find out the solution.