Level 23
Let's take a look at the source code.
public function put($path, $contents, $lock = false)
{
return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);
}
/**
* Store the uploaded file on the disk.
*
* @param string $path
* @param \Illuminate\Http\File|\Illuminate\Http\UploadedFile $file
* @param array $options
* @return string|false
*/
public function putFile($path, $file, $options = [])
{
return $this->putFileAs($path, $file, $file->hashName(), $options);
}
put does indeed only use file_put_contents. putFile on the other hand is used to save on the disk a file that has been uploaded (Http Request).
2 likes