Created
          September 5, 2013 03:41 
        
      - 
      
 - 
        
Save patrickmaciel/6445811 to your computer and use it in GitHub Desktop.  
    post update - 1970
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * Update the specified resource in storage. | |
| * | |
| * @param int $id | |
| * @return Response | |
| */ | |
| public function postUpdate($id) | |
| { | |
| $registration_period = \RegistrationPeriod::find($id); | |
| if ($registration_period != null) { | |
| $registration_period->image = Upload::save(\Input::file('image'), \RegistrationPeriod::$upload, \Input::get('image_old'), $registration_period->created_at); | |
| $registration_period->start = date('Y-m-d', strtotime(\Input::get('start'))); | |
| $registration_period->end = date('Y-m-d', strtotime(\Input::get('end'))); | |
| $registration_period->active = \Input::get('active'); | |
| $registration_period->save(); | |
| \Session::flash('success', 'Período de Inscrição atualizado com sucesso'); | |
| return \Redirect::route('admin.registration_period'); | |
| } | |
| \Session::flash('error', 'Período de Inscrição inválido ou não encontrado'); | |
| return \Redirect::back(); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment