1<?php
2
3namespace App\Http\Controllers;
4
5use App\Http\Controllers\Controller;
6use Illuminate\Http\Request;
7use Illuminate\Support\Facades\Hash;
8
9class PasswordController extends Controller
10{
11 /**
12 * Update the password for the user.
13 *
14 * @param \Illuminate\Http\Request $request
15 * @return \Illuminate\Http\Response
16 */
17 public function update(Request $request)
18 {
19 // Validate the new password length...
20
21 $request->user()->fill([
22 'password' => Hash::make($request->newPassword)
23 ])->save();
24 }
25}