Commit 33c60274 authored by Koen Schmeets's avatar Koen Schmeets

Adding has_file method

Signed-off-by: 's avatarKoen Schmeets <k.schmeets@gmail.com>
parent 26730cd5
...@@ -178,6 +178,18 @@ class Input { ...@@ -178,6 +178,18 @@ class Input {
return array_get($_FILES, $key, $default); return array_get($_FILES, $key, $default);
} }
/**
* Determine if the uploaded data contains a file.
*
* @param string $key
* @return bool
*/
public static function has_file($key)
{
$file = static::file($key);
return ! empty($file['tmp_name']);
}
/** /**
* Move an uploaded file to permanent storage. * Move an uploaded file to permanent storage.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment