source: app/Http/Controllers/Auth/VerifyNewEmailController.php@ c5e383e

Last change on this file since c5e383e was 0a1fb54, checked in by beratkjufliju <kufliju@…>, 3 years ago

bug fixes

  • Property mode set to 100644
File size: 785 bytes
RevLine 
[0a1fb54]1<?php
2
3namespace App\Http\Controllers\Auth;
4
5use App\Helpers\Alert;
6use App\Http\Requests\Auth\VerifyNewEmailRequest;
7use App\Models\User;
8use App\Http\Controllers\Controller;
9
10class VerifyNewEmailController extends Controller
11{
12 public function __construct()
13 {
14 $this->middleware("checkVerifyNewEmail");
15 }
16
17 public function create($id, $token)
18 {
19 return view("auth.verify_new_email")->with([
20 "id" => $id,
21 "token" => $token
22 ]);
23 }
24
25 public function verify(VerifyNewEmailRequest $request, $id, $token)
26 {
27 $user = User::find($id);
28 $user->is_active = true;
29 $user->save();
30
31 Alert::flash("Email address verified successfully");
32
33 return redirect()->route("auth.login");
34 }
35}
Note: See TracBrowser for help on using the repository browser.