/** * Return a pictuners' pictunes and profile * * @param username * @return \Illuminate\Http\Response */ public function user_pictunes($tld, $username) { // There's actually a username $userRequested = User::where(['username' => $username])->firstOrFail(); $viewData['pictunes'] = json_encode($userRequested->pictunes()->get()); return view('pictune.dashboard', $viewData); }
/** * Show a users' profile and pictunes * * @param username * @return \Illuminate\Http\Response */ public function user_pictunes($tld, $username) { $viewData['pictunes'] = json_encode(User::where(['username' => $username])->firstOrFail()->pictunesWithUserInfo($tld, $username)->get()); return view('pictune.dashboard', $viewData); }