<?php

namespace App\Http\Controllers\Distributor;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Models\User;
use App\Http\Requests\PasswordRequest;

class ProfileController extends Controller
{
    public function show()
    {
        return view('Distributor.profile');
    }

    public function password(PasswordRequest $request)
    {
        $edit_user = User::find(Auth::id());
        $edit_user->update([
            'password' => $request->input('password')
        ]);

        return back()->with('success', 'رمز عبور تغییر کرد');
    }
}
