App\Services\Filesystem\LaravelFilesystem::put PHP Method

put() public method

Write a file.
public put ( string $path, string $contents ) : mixed
$path string File path
$contents string Contents to write a file
return mixed
    public function put($path, $contents)
    {
        return $this->fs->put($path, $contents);
    }

Usage Example

 public function test_Should_WriteFile()
 {
     $fs = new LaravelFilesystem($this->app['files']);
     $fs->put(vfsStream::url('rootDir/file'), 'contents');
     $putFile = $this->rootDir->getChild('file')->getContent();
     $this->assertEquals('contents', $putFile);
 }