Van1310
126
2
Laravel

auth data empty

Posted 1 month 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.

Reply to

Use Markdown with GitHub-flavored code blocks.