From e3317324b0cd69c025acc2c33d898017a4cb61ce Mon Sep 17 00:00:00 2001 From: Dayle Rees Date: Sat, 16 Jun 2012 11:42:25 +0100 Subject: [PATCH] added clear() method to the input class Signed-off-by: Dayle Rees --- laravel/documentation/input.md | 8 +++++++- laravel/input.php | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/laravel/documentation/input.md b/laravel/documentation/input.md index 14221ecd..4387721e 100644 --- a/laravel/documentation/input.md +++ b/laravel/documentation/input.md @@ -145,4 +145,10 @@ #### Merging new data into the current input: #### Replacing the entire input array with new data: - Input::merge(array('doctor' => 'Bones', 'captain' => 'Kirk')); \ No newline at end of file + Input::merge(array('doctor' => 'Bones', 'captain' => 'Kirk')); + +## Clearing Input + +To clear all input data for the current request, using the `clear()` method, for example: + + Input::clear(); \ No newline at end of file diff --git a/laravel/input.php b/laravel/input.php index 6a28b17f..8d712871 100644 --- a/laravel/input.php +++ b/laravel/input.php @@ -287,4 +287,13 @@ public static function replace(array $input) Request::foundation()->request->replace($input); } + /** + * Clear the input for the current request. + * @return void + */ + public static function clear() + { + Request::foundation()->request->replace(array()); + } + } \ No newline at end of file