Van1310
4 months ago

auth data empty

Posted 4 months ago by Van1310

i try to authenticate data get pin number but when user register redirect to pin number page error like

Trying to get property of non-object

here is my pin number controller

public function pin_view()
    {   
        $id=\Auth::user()->id;  //error in this line  Trying to get property of non-object 
        $pin=$user;
        return view('otp',compact('pin'));
    }

when i check return value is empty

public function pin_view()
    {   
        $id=\Auth::user()->id;  //error in this line  Trying to get property of non-object 
        //$pin=$user;
    return $id;
    }

how to fix it thank you

Please sign in or create an account to participate in this conversation.