Exemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\CreateStudentProfileRequest $request)
 {
     $data = $request->all();
     //dd($data);
     $student_profile = new \App\StudentProfile($data);
     $student_profile->save();
     return redirect('auth/student');
     //
 }
Exemplo n.º 2
0
 public function getProfileAttribute()
 {
     if ($this->type == 'Student') {
         //$id_student= $this->id;
         $profile = \App\StudentProfile::where('id_student', $this->id)->get();
         //find($id_student);
         //dd($profile);
         return $profile;
     } else {
         return null;
     }
 }
Exemplo n.º 3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Requests\EditStudentProfileRequest $request, $id)
 {
     $data = $request->all();
     $studentProfile = \App\StudentProfile::find($id);
     $studentProfile->fill($data);
     $studentProfile->save();
     \Session::flash('message_update', 'The studnet profile [' . $studentProfile->enrollment . '] with id#' . $studentProfile->id . ' was updated');
     return redirect()->back();
 }