/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(StoreNewEducationRequest $request) { $data = $request->only(['degree', 'school', 'start_date', 'end_date', 'enabled', 'type']); $education = new Education(); $education->degree = $data['degree']; $education->school = $data['school']; $education->type = $data['type']; $education->start_date = $data['start_date']; $education->end_date = $data['end_date']; $education->user_id = Auth::user()->id; $education->save(); return $this->response->collection(Auth::user()->educations, new EducationTransformer()); }