Comparison between 2 array [Laravel]

Posted 1 year ago by mlazuardy

I Have 1 Array called " social " where this array is listing some social account from my user. I make Social controller like this

   public function socialAccount($username)
    {
        $user = $this->getUserByUsername($username);
        return view('profile.social',compact('user'));

    }

so the view will just listing the array from $username parameter, not all user, for example. My name is Michael, and I just have 1 social account called "facebook". im including 3 socialite provider . facebook, google, and github. So, Michael didnt have google and github,

even my social account is just 1, its still array so i want to make comparison. if i just have facebook social account, then the google and github status will return ` your google and github account is not activated" . So what could i do? make manual array again like

$social = ['google','github','facebook'];

?

sorry for my bad english, i hope you guys understand my problem

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