Published 1 month ago by madsynn
Can you guys help me. I am trying to generate text files that contain the looped data from each crud when a button is pushed. Can anyone help me i have never had to do something like this with laravel before and i am at a loss on how to do it.
lets say crud is called config i need to print all values from config into a text.txt file in the public folder. Do i do this with a controller and use that to loop through it and create the text file when the button is pushed or is there a better and easier way to make this happen.
Any of your thoughts an suggestions would be very helpful and welcome please.
Thank you for the help in advance.
@jlrdw Sorry i should have been more clear. I am not looking for the best functions or php ways to write the files im looking for the best way to create the process in laravel.
Using controllers or listeners or custom provider or any other means of making this work best in laravel.
pushing the button in the client should trigger the request in the controller, then use the Storage helper to save the raw data
If assembling the data gets too heavy for a controller, outsource it to a dedicated class