Append text to a file in Laravel
In Laravel some time you want to add error logging or some other text information related to your code running status in a file. I'm going to show how you can achieve that First you need to use the inbuilt File class inside your controller, for that include the below line on the controller above your class definition (Refer the below picture) use File; Once you include the above line now you can call the function from the File class, the function we need for appending the text to a file is append() function. This function will append any text you are providing to the end of the already created file, or if the file is not available it will create a file in the name you provide and append the text to it. Next thing is we need to pass two parameters to this function, first parameter is storage location with file name and the second one is the text you want to append (Refer the belo picture) In the above picture I'm using a function in the place of storage location and file...