jeudi 4 mai 2023

Laravel file storage issues

I have an issue with Laravel

Case:

  1. Create a file test.csv with data "abcdefg"
  2. Delete the file test.csv
  3. Recreate the file test.csv with data "zmamamama"

My code

$data = "asdsdsds";

 if(file_exists(storage_path('app/public/test/test.csv'))){
   unlink(storage_path('app/public/test/test.csv' ));
 }

Excel::store(new SomeTest($data), '/public/test/test.csv');

The issue is that test.csv still shows the old data ("abcdefg") even though the file o nthe local server show the new data accessed the file from the URL test.com/storage/test/test.csv

I'm using CentOS on the machine running my Laravel server.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire