src/Traits/TakiRegistration.php
public function getActivate(Request $request, $token)
    {

        $user = User::where('token', $token)->first();
        if (!$user) {
            throw new NotFoundHttpException;
        }

        $user->is_activated = true;
        $user->token        = null;
        $user->save();

        if (method_exists($this, 'userActivated')) {
            $this->userRegistered($request, $token, $user);
        }

        return view($this->getUserActivatingView(), ['user' => $user, 'token' => $token]);
    }
public function getActivate(Request $request, $token)
    {

        $user = User::where('token', $token)->first();
        if (!$user) {
            throw new NotFoundHttpException;
        }

        $user->is_activated = true;
        $user->token        = null;
        $user->save();

        if (method_exists($this, 'userActivated')) {
            $this->userRegistered($request, $token, $user);
        }

        return view($this->getUserActivatingView(), ['user' => $user, 'token' => $token]);
    }
public function getActivate ( Request $ request , $ token ) { $ user = User :: where ( 'token' , $ token ) -> first ( ) ; if ( ! $ user ) { throw new NotFoundHttpException ; } $ user -> is_activated = true ; $ user -> token = null ; $ user -> save ( ) ; if ( method_exists ( $ this , 'userActivated' ) ) { $ this -> userRegistered ( $ request , $ token , $ user ) ; } return view ( $ this -> getUserActivatingView ( ) , [ 'user' => $ user , 'token' => $ token ] ) ; }
Activate a user by a link

@param $token

@return \Illuminate\View\View
@throws NotFoundHttpException
Activate a user by a link