public function putType($id) { $type = \Input::get('type') . 's'; $acc = \App\Accomplishment::find($id); if ($acc) { $acc->{$type} = $acc->{$type} + 1; $acc->save(); return $acc; } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($project_id, $id) { $accomplishment = Accomplishment::find($id); $accomplishment->delete(); flash()->success('Accomplishment has been successfully deleted!'); return redirect()->action('ProjectsController@show', $project_id); }