Problem in calling the laravel database

0

It turns out that I'm trying to call if there is a field in the database, and if it does not exist, create it, but when I put it into operation, it generates this error:

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to undefined method App\Entities\SocialLite\SocialEntity::where()

this code:

  $sameSocialId = SocialEntity::where('social_id', '=', $socialUser->id)->where('provider', '=', $provider)->get();

        if (empty($sameSocialId)) {
            $socialData = new SocialEntity;
            $socialData->social_id = $socialUser->id;
            $socialData->provider= $provider;
            $userInDB->social()->save($socialData);
        }
    
asked by Andrés Cantillo 23.11.2018 в 18:25
source

0 answers