Search code examples
laravellocal-storagelaravel-5.6laravel-filesystem

Understanding syntax of Storage filesystem in Laravel 5.6


enter image description here

I'm searching for this syntax but I cannot find any explanation... I found some examples but everyone is using the method storeAs(), store() or move() straight away.

I can't understand what $file_contents is. What is this for? What shall it contain?


Solution

  • Put is used to store contents in a file. So $file_content being the data you want to store in 'filename'.

    https://laravel.com/docs/5.6/filesystem#storing-files

    This would be similar to file_put_contents.