Added Passkey login, fixed password reset as a result of updating laravel
This commit is contained in:
@@ -3,14 +3,38 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
use App\Http\Requests\UserEdit;
|
||||
use App\Models\{Supplier,User};
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
/**
|
||||
* Update user settings
|
||||
*
|
||||
* @param UserEdit $request
|
||||
* @param User $o
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function edit(UserEdit $request,User $o): RedirectResponse
|
||||
{
|
||||
foreach (Arr::except($request->validated(),['password']) as $field => $value)
|
||||
$o->{$field} = $value;
|
||||
|
||||
if ($x=$request->validated('password'))
|
||||
$o->password = Hash::make($x);
|
||||
|
||||
return redirect()
|
||||
->back()
|
||||
->with('success',($o->isDirty() && $o->save()) ? 'User Updated' : 'No Changes');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a supplier to a user's profile
|
||||
*
|
||||
|
Reference in New Issue
Block a user