PATH:
home
/
rwabteecom
/
project_11
/
app
/
Http
/
Controllers
/
Admin
/
Profile
/
Editing: ProfileController.php
<?php namespace App\Http\Controllers\Admin\Profile; use App\Http\Controllers\Controller; use App\Http\Requests\Admin\Profile\ProfileRequest; use App\Http\Requests\Admin\Profile\UpdatePasswordRequest; use App\Services\Admin\AdminServices; use Auth; use Exception; use Log; class ProfileController extends Controller { public function __construct(private readonly AdminServices $adminServices) { } public function index() { return view("admin.pages.profile.profile"); } public function update(ProfileRequest $request) { try { $this->adminServices->updateProfile(Auth::id(), $request); } catch (Exception $exception) { Log::error($exception->getMessage()); return back()->with("error", $exception->getMessage())->withInput(); } return back()->with("success", __("Profile Updated Successfully")); } public function updatePassword(UpdatePasswordRequest $request) { try { $this->adminServices->updatePassword(Auth::id(), $request); } catch (Exception $exception) { Log::error($exception->getMessage()); return back()->with("error", $exception->getMessage())->withInput(); } return back()->with("success", __("Password Updated Successfully")); } }
SAVE
CANCEL