1

I got this error when users click their verification email link. I use $gs as general settings for my administration panel to choose users will verify their email or not . But its ON and thus this error.

        $data[0] = 1;
        $data[1] = redirect()->intended(route('user-dashboard'))->getTargetUrl();
        return response()->json($data);
        }

}

public function token($token)
{
        **if($gs->is_verification_email == 0)**
        {       
    $user = User::where('verification_link','=',$token)->first();
    if(isset($user))
    {
        $user->email_verified = 'Yes';
        $user->update();

                if (Session::has('affilate')) 
                {
                    $referral = User::findOrFail(Session::get('affilate'));
                    $user->referral_id = $referral->id;
                    $user->update();
                }


        $notification = new Notification;
        $notification->user_id = $user->id;
        $notification->save();
        Auth::guard('web')->login($user); 
        return redirect()->route('user-dashboard')->with('success','Email Verified Successfully');

Arguments "Undefined variable: gs"

Myk
  • 11
  • 1
  • The error message is self explaining: "the variable $gs is undefined". It's definetly not inside the method. Be sure, it's a global varible. Or is it an object of your class? Then `$this->gs->` might help – mixable Jun 17 '20 at 15:13
  • If it's global, you need to specify "global $gs" at the beginning of your method. See the linked duplicate for more information about declaring variables. – thelr Jun 17 '20 at 15:17
  • this is the link to the error[http://thedoublebtc.com/user/register/verify/75272404f0de9cdb8cd4e7afbe4d2171] , help me with the right code – Myk Jun 17 '20 at 17:12

0 Answers0