I have a test.txt file in my Laravel public folder which I simply want to delete from my controller by using
unlink('public/test.txt');
Whenever I try to run, I keep getting a 'file not found' error
ErrorException in WidgetController.php line 32:
unlink('public/test.txt'): No such file or directory
What seems to be the problem here?
Copyright Notice:Content Author:「BangularTK」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40481382/laravel-delete-file