PHP 8.2.30
Preview: ProfileController.php Size: 1.63 KB
/proc/thread-self/root/home/byroehnu/easetack.com/app/Http/Controllers/Frontend/ProfileController.php

<?php

namespace App\Http\Controllers\Frontend;

use App\Http\Controllers\Controller;
use App\Http\Requests\Frontend\PasswordUpdateRequest;
use App\Http\Requests\Frontend\ProfileUpdateRequest;
use App\Models\User;
use App\Repositories\Frontend\ProfileRepository;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Lang;
use Inertia\Inertia;
use Inertia\Response;

class ProfileController extends Controller
{
    /**
     * Show the form for editing the specified resource.
     */
    public function edit(): Response
    {
        return Inertia::render('User/Profile/Edit');
    }

    /**
     * Update the specified resource in storage.
     */
    public function update(ProfileUpdateRequest $request, ProfileRepository $repository): RedirectResponse
    {
        try {
            $repository->updateProfile($request);

            return redirect()->back()->with('success', Lang::get('Profile successfully updated'));
        } catch (\Exception $e) {
            return redirect()->back()->with('error', 'Error updating profile: '.$e->getMessage());
        }
    }

    /**
     * Show the form for editing the specified resource.
     */
    public function changePassword(): Response
    {
        return Inertia::render('User/Profile/ChangePassword');
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  User  $user
     */
    public function updatePassword(PasswordUpdateRequest $request, ProfileRepository $repository): RedirectResponse
    {
        $repository->updatePassword($request);

        return redirect()->back()->with('success', Lang::get('Password updated successfully'));
    }
}

Directory Contents

Dirs: 0 × Files: 19

Name Size Perms Modified Actions
2.51 KB lrw-rw-rw- 2025-04-26 11:30:31
Edit Download
2.26 KB lrw-rw-rw- 2025-05-08 11:48:26
Edit Download
3.24 KB lrw-rw-rw- 2025-05-15 11:24:11
Edit Download
551 B lrw-rw-rw- 2025-04-19 04:22:18
Edit Download
1.72 KB lrw-rw-rw- 2025-05-08 11:48:26
Edit Download
5.96 KB lrw-rw-rw- 2025-05-08 11:48:26
Edit Download
4.00 KB lrw-rw-rw- 2025-05-15 11:24:11
Edit Download
2.63 KB lrw-rw-rw- 2025-05-08 11:48:26
Edit Download
3.47 KB lrw-rw-rw- 2025-05-08 11:48:26
Edit Download
2.29 KB lrw-rw-rw- 2025-05-08 11:48:26
Edit Download
1.63 KB lrw-rw-rw- 2025-04-15 10:33:57
Edit Download
2.00 KB lrw-rw-rw- 2025-05-08 11:48:26
Edit Download
1.44 KB lrw-rw-rw- 2025-04-19 04:22:18
Edit Download
2.13 KB lrw-rw-rw- 2025-05-08 11:48:26
Edit Download
408 B lrw-rw-rw- 2025-04-19 04:22:18
Edit Download
532 B lrw-rw-rw- 2025-04-08 04:12:56
Edit Download
2.09 KB lrw-rw-rw- 2025-04-30 16:51:31
Edit Download
1.91 KB lrw-rw-rw- 2025-04-13 07:02:31
Edit Download
2.96 KB lrw-rw-rw- 2025-05-08 11:48:26
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).