title: Laravel fopen() cant create/read file
body: <p>so I have this Laravel project and I want to export an array to a json file to use it later. My permissions on the storage folder are 777 but when I do</p>
  
  <pre><code>$line=[
    'key1'=&gt;'value1',
  ];
  file_put_contents("storage/app/test.json",json_encode($line));
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>$line=[
    'key1'=&gt;'value1',
  ];
  file_put_contents($_SERVER['DOCUMENT_ROOT']."/storage/app/test.json",json_encode($line));
  </code></pre>
  
  <p>and in both cases (plus some more) I get this error</p>
  
  <pre><code>file_put_contents(storage/app/test.json): failed to open stream: No such file or directory
  </code></pre>
  
  <p>Do you have any idea why is this happening?</p>
  
  <p>EDIT: The folders exist</p>