vendredi 23 août 2019

why can't i send the logged in user data to vue using Auth::id()

Why it doesn't work with Auth::id() but work with a hardcoded value like 1

This doesn't work

public function getTwitterUser()
{
    $auth_id = Auth::id();

    $getuser = Twitterac::where('user_id', $auth_id)->get();

    return $getuser;
}

But this Dose

public function getTwitterUser()
{
    $auth_id = 1;

    $getuser = Twitterac::where('user_id', $auth_id)->get();

    return $getuser;
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire