diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 609c2e4217b110020ffdd23cc4ce1ec2dd3c2f4f..c1bbf8812b6e9a1a0e2c931f3ccf2c6fa05bfac7 100755 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -88,33 +88,4 @@ class AuthController extends Controller return $user; } - - public function edit() - { - return view('user.profile')->with('user', \Auth::user()); - } - - public function update(\App\Http\Requests\StoreProfileRequest $request) - { - $data = $request->all(); - $user = \Auth::user(); - $user->update($data); - - if ($request->hasFile('image') && $request->file('image')->isValid()) { - $path = $request->file('image')->getRealPath(); - $mime_type = $request->file('image')->getClientOriginalExtension(); - $destination_path = 'profiles/' . $user->id . '.' . $mime_type; - \Storage::put( - $destination_path, - file_get_contents($path) - ); - $user->image = $destination_path; - $user->save(); - } - - $updateMsg = 'Update profile completed'; - - return redirect('/profile/edit') - ->with('updateMsg', $updateMsg); - } } diff --git a/app/Http/routes.php b/app/Http/routes.php index cfbe0380cca459949650b05733f7e29550fb3b98..b635ce7e87a09d0de27c785e1d94d36d72cd062d 100755 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -21,8 +21,8 @@ Route::get('home', 'HomeController@index'); Route::group(['middleware' => 'auth'], function () { - Route::get('profile/edit', 'Auth\AuthController@edit'); - Route::put('profile', 'Auth\AuthController@update'); + Route::get('profile/edit', 'ProfileController@edit'); + Route::put('profile', 'ProfileController@update'); Route::resource('posts', 'PostController'); Route::put('posts/{id}/like', 'PostController@like'); Route::put('posts/{id}/unlike', 'PostController@unlike');