/** * Return an image for a particular pictuner * * @param int $id * @return */ public function pictunerImage($tld, $id) { $imagePath = "pictuner_assets/selfies/" . User::find($id)->selfie_name; $mimeType = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $imagePath); header("Content-Type: " . $mimeType); return response(readfile($imagePath)); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { User::findOrFail($id)->delete(); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { return User::create(['username' => $data['username'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }
/** * 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); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $viewData['user'] = User::findOrFail($id); return view("user.delete", $viewData); }