title: syntax error, unexpected 'public' (T_PUBLIC)
body: <p>I am getting an error which is shouting at me that appears to be a syntax error?
  I am really not sure where I am going wrong?
      
  
  <pre><code>public function upload() {
    // getting all of the post data
    $file = array('image' =&gt; Input::file('image'));
    // setting up rules
    $rules = array('image' =&gt; 'required',); //mimes:jpeg,bmp,png and for max size max:10000
    // doing the validation, passing post data, rules and the messages
    $validator = Validator::make($file, $rules);
    if ($validator-&gt;fails()) {
      // send back to the page with the input data and errors
      return Redirect::to('upload')-&gt;withInput()-&gt;withErrors($validator);
    }
    else {
      // checking file is valid.
      if (Input::file('image')-&gt;isValid()) {
        $destinationPath = 'uploads'; // upload path
        $extension = Input::file('image')-&gt;getClientOriginalExtension(); // getting image extension
        $fileName = rand(11111,99999).'.'.$extension; // renameing image
        Input::file('image')-&gt;move($destinationPath, $fileName); // uploading file to given path
        // sending back with message
        Session::flash('success', 'Upload successfully'); 
        return Redirect::to('upload');
      }
      else {
        // sending back with error message.
        Session::flash('error', 'uploaded file is not valid');
        return Redirect::to('upload');
      }
    }
  }
  </code></pre>