/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $cv = $this->cv_gestion->store($request->all()); $loisir = new Loisir(); $loisir->cv_id = $cv->id; $loisir->save(); return ['cv_id' => $cv->id, 'etudiant_id' => $cv->etudiant_id]; }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request = null) { $cv = $this->cv_gestion->store($request->all()); $loisir = new Loisir(); $loisir->cv_id = $cv->id; $loisir->save(); return redirect()->route('createcv', [$cv->id]); }
/** * Update a model. * * @param array $inputs * @param $id * @return void */ public function update($inputs, $id) { $this->model = Loisir::find($id); return $this->save($inputs); }