/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update(OffreStageRequest $request, $id, CompetenceRepository $competence) { $offre = OffreStage::find($id); $offre->user_id = Auth::user()->id; $offre->title = Input::get('title'); $offre->promotion_id = Promotion::find(Input::get('promotion'))->id; $offre->specialite_id = Input::get('specialite'); //TODO parse date peut etre en faire un service? $date = Input::get('date_debut'); $offre->date_debut = date('Y-m-d', strtotime($date)); $offre->duree = Input::get('duree'); $offre->description = Input::get('description'); $offre->nom_contact = Input::get('nom_contact'); $offre->email = Input::get('email'); $offre->tel = Input::get('tel'); $offre->horaire = Input::get('horaire'); $offre->adresse_stage = Input::get('adresse_stage'); $offre->gratification = Input::get('gratification'); $offre->save(); $competence->saveMultipe(Input::get('competence'), $offre); return $offre; }
/** * Traitement du formulaire de compétence * * @return Redirect */ public function postCompetence(CompetenceRepository $repository) { $repository->saveMultipe(Input::get('competence'), Auth::user()->user); return Redirect::refresh()->with('flash_success', 'Modification Compétence enregistré!')->withInput(); }