public function edit() { $user = User::findOrFail(Auth::user()->id); $entity = Entity::where('user_id', Auth::user()->id)->firstOrFail(); $about = About::where('user_id', Auth::user()->id)->firstOrFail(); $contact = Contact::where('user_id', Auth::user()->id)->firstOrFail(); $home = Home::where('user_id', Auth::user()->id)->firstOrFail(); $quote = Quote::where('user_id', Auth::user()->id)->get(); $quote_count = $quote->count(); $skill = Skill::where('user_id', Auth::user()->id)->get(); $skill_count = $skill->count(); $skill_slider = SkillSlider::where('user_id', Auth::user()->id)->get(); $skill_slider_count = $skill_slider->count(); $portfolio_piece = PortfolioPiece::where('user_id', Auth::user()->id)->get(); $portfolio_piece_count = $portfolio_piece->count(); return view('edit')->with('user', $user)->with('home', $home)->with('entity', $entity)->with('contact', $contact)->with('about', $about)->with('skill', $skill)->with('skill_count', $skill_count)->with('quote', $quote)->with('quote_count', $quote_count)->with('skill_slider', $skill_slider)->with('skill_slider_count', $skill_slider_count)->with('portfolio_piece', $portfolio_piece)->with('portfolio_piece_count', $portfolio_piece_count); }
public function store(Request $request) { $about = About::where('user_id', Auth::user()->id)->first(); if ($about) { $about->hakkimda = $request->hakkimda; $about->save(); flash('Güncelleme işlemi başarıyla gercekleşti.', 'info'); return redirect()->back(); } else { $about = new About(); $about->user_id = Auth::user()->id; $about->hakkimda = $request->hakkimda; $about->save(); flash('Güncelleme işlemi başarıyla gercekleşti.', 'info'); return redirect()->back(); } }
public function updateAboutMe() { $user = User::find(Auth::user()->id); $about = About::where('user_id', Auth::user()->id)->firstOrFail(); if (isset($user) && $about != NULL) { if (Input::get('about_first_title') != '') { $about->first_title = Input::get('about_first_title'); } if (Input::get('about_first_caption') != '') { $about->first_caption = Input::get('about_first_caption'); } if (Input::get('about_second_title') != '') { $about->second_title = Input::get('about_second_title'); } if (Input::get('about_second_caption') != '') { $about->second_caption = Input::get('about_second_caption'); } if (Input::get('about_third_title') != '') { $about->third_title = Input::get('about_third_title'); } if (Input::get('about_third_caption') != '') { $about->third_caption = Input::get('about_third_caption'); } if (Input::get('about_extra_1') != '') { $about->extra_1 = Input::get('about_extra_1'); } if (Input::get('about_extra_2') != '') { $about->extra_2 = Input::get('about_extra_2'); } $about->save(); return redirect('home')->with('status', 'success'); } else { return 'An error has occurred'; //'no'; } }
/** * edit favs data. * * @param object $request * * * @return json */ public function editfavs(Request $request) { $email = $request->email; $favs = $request->favs; try { $userID = User::where('email', $email)->get(['id']); if (About::where('user_id', $userID[0]->id)->update(['favourites' => $favs])) { return response()->json(['status' => 200], 200); } else { return response()->json(['status' => 200], 200); } } catch (Illuminate\Database\QueryException $e) { return response()->json(['status' => 200], 200); } }
public function about() { $about = \App\About::where('active', '1')->firstOrFail(); return view('about', ['page' => 'about', 'about' => $about]); }