/** * Get user collection. * * @param int $id * @return Illuminate\Support\Collection */ public function edit($id) { $profile = $this->profile->find($id); //dd($profile); return compact('profile'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy(DeleteRequest $request, $id) { //dd('destroy'); // $this->profile->destroy($id); $profile = Profile::find($id); // $profile->roles()->detach(); $profile->delete(); // $this->user->destroy($id); // return redirect('user')->with('ok', trans('back/users.destroyed')); Flash::success(trans('kotoba::account.success.delete')); return redirect('profiles'); }
/** * @param $data * @return static */ public function DeleteProfile($data) { //dd($data); $check = $this->checkProfileExists($data->email); $profile_id = $this->getProfile($data->id); //dd($profile_id); if ($check != null) { $profile = Profile::find($profile_id); //dd($profile); $profile->delete(); return; } }