public function unlink($provider)
    {
        $this->checkDisabled();

        $user = User::findOrFail(Auth::id());
        $redirectAfter = $user->hasPermission('laralum::access') || $user->superAdmin() ? route('laralum::social.integrations') : url('/');

        $link = Social::where(['user_id' => Auth::id(), 'provider' => $provider])->first();

        if (!$link) {
            return redirect($redirectAfter)->with('success', __('laralum_social::general.link_not_found', ['provider' => $provider]));
        }

        $link->delete();

        return redirect($redirectAfter)->with('success', __('laralum_social::general.unlinked', ['provider' => $provider]));
    }
public function unlink($provider)
    {
        $this->checkDisabled();

        $user = User::findOrFail(Auth::id());
        $redirectAfter = $user->hasPermission('laralum::access') || $user->superAdmin() ? route('laralum::social.integrations') : url('/');

        $link = Social::where(['user_id' => Auth::id(), 'provider' => $provider])->first();

        if (!$link) {
            return redirect($redirectAfter)->with('success', __('laralum_social::general.link_not_found', ['provider' => $provider]));
        }

        $link->delete();

        return redirect($redirectAfter)->with('success', __('laralum_social::general.unlinked', ['provider' => $provider]));
    }
public function unlink ( $ provider ) { $ this -> checkDisabled ( ) ; $ user = User :: findOrFail ( Auth :: id ( ) ) ; $ redirectAfter = $ user -> hasPermission ( 'laralum::access' ) || $ user -> superAdmin ( ) ? route ( 'laralum::social.integrations' ) : url ( '/' ) ; $ link = Social :: where ( [ 'user_id' => Auth :: id ( ) , 'provider' => $ provider ] ) -> first ( ) ; if ( ! $ link ) { return redirect ( $ redirectAfter ) -> with ( 'success' , __ ( 'laralum_social::general.link_not_found' , [ 'provider' => $ provider ] ) ) ; } $ link -> delete ( ) ; return redirect ( $ redirectAfter ) -> with ( 'success' , __ ( 'laralum_social::general.unlinked' , [ 'provider' => $ provider ] ) ) ; }
Unlink the social account.

@param string $provider

@return Response
Unlink the social account .