diff --git a/laravel/input.php b/laravel/input.php index 7c294a90..f08d7be8 100644 --- a/laravel/input.php +++ b/laravel/input.php @@ -197,6 +197,18 @@ public static function file($key = null, $default = null) 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. *