From 3d83b65bb73f53a7271d6658ac961e92f570d245 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 22 Aug 2011 22:38:20 -0500 Subject: [PATCH] moved file::upload to input::upload. --- laravel/file.php | 11 ----------- laravel/input.php | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/laravel/file.php b/laravel/file.php index 1ae1b69e..b40fdbde 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -154,15 +154,4 @@ public static function download($path, $name = null) return $response; } - /** - * Move an uploaded file to storage. - * - * @param string $key - * @param string $path - * @return bool - */ - public static function upload($key, $path) - { - return array_key_exists($key, $_FILES) ? move_uploaded_file($_FILES[$key]['tmp_name'], $path) : false; - } } \ No newline at end of file diff --git a/laravel/input.php b/laravel/input.php index e3dbf228..d1f70182 100644 --- a/laravel/input.php +++ b/laravel/input.php @@ -86,6 +86,18 @@ public static function file($key = null, $default = null) return Arr::get($_FILES, $key, $default); } + /** + * Move an uploaded file to permanent storage. + * + * @param string $key + * @param string $path + * @return bool + */ + public static function upload($key, $path) + { + return array_key_exists($key, $_FILES) ? move_uploaded_file($_FILES[$key]['tmp_name'], $path) : false; + } + /** * Hydrate the input data for the request. *