source:
app/Http/Controllers/Auth/VerifyNewEmailController.php@
75a169d
Last change on this file since 75a169d was 7304c7f, checked in by , 3 years ago | |
---|---|
|
|
File size: 690 bytes |
Line | |
---|---|
1 | <?php |
2 | |
3 | namespace App\Http\Controllers\Auth; |
4 | |
5 | use App\Http\Requests\Auth\VerifyNewEmailRequest; |
6 | use App\Models\User; |
7 | use App\Http\Controllers\Controller; |
8 | |
9 | class VerifyNewEmailController extends Controller |
10 | { |
11 | public function __construct() |
12 | { |
13 | $this->middleware("checkVerifyNewEmail"); |
14 | } |
15 | |
16 | public function create($id, $token) |
17 | { |
18 | return view("auth.verify")->with([ |
19 | "id" => $id, |
20 | "token" => $token |
21 | ]); |
22 | } |
23 | |
24 | public function verify(VerifyNewEmailRequest $request, $id, $token) |
25 | { |
26 | $user = User::find($id); |
27 | $user->is_active = true; |
28 | $user->save(); |
29 | |
30 | return redirect()->route("auth.login"); |
31 | } |
32 | } |
Note:
See TracBrowser
for help on using the repository browser.