File



File

File service is a collection of useful file related function.

In a controller the file will need importing:

use File;

In a view it's already included in app/Config/App.php

File::exists($path);

Determine is the file path exists.

File::get($path);

Gets the content of a file

File::getRequire($path);

Get the returned value of a file.

File::requireOnce($file);

Require the given file once.

File::put($path, $contents, $lock = false)

Write the contents of a file.

File::append($path, $data);

Append data to a file.

File::delete($paths);

Delete the file at a given path.

File::move($path, $target);

Move a file to a new location.