src/Traits/Friendly.php
public function approve($model)
    {
        $approvedAtLeastOne = false;

        if ($model->friends->count()) {
            foreach ($model->friends as $friend) {
                if ((int) $friend->getKey() === (int) $this->getKey()) {
                    $friend->pivot->approved_at = new \Carbon\Carbon;
                    $friend->pivot->save();
                    $this->resetFriends();

                    $approvedAtLeastOne = true;
                }
            }
        }

        return $approvedAtLeastOne;
    }
public function approve($model)
    {
        $approvedAtLeastOne = false;

        if ($model->friends->count()) {
            foreach ($model->friends as $friend) {
                if ((int) $friend->getKey() === (int) $this->getKey()) {
                    $friend->pivot->approved_at = new \Carbon\Carbon;
                    $friend->pivot->save();
                    $this->resetFriends();

                    $approvedAtLeastOne = true;
                }
            }
        }

        return $approvedAtLeastOne;
    }
public function approve ( $ model ) { $ approvedAtLeastOne = false ; if ( $ model -> friends -> count ( ) ) { foreach ( $ model -> friends as $ friend ) { if ( ( int ) $ friend -> getKey ( ) === ( int ) $ this -> getKey ( ) ) { $ friend -> pivot -> approved_at = new \ Carbon \ Carbon ; $ friend -> pivot -> save ( ) ; $ this -> resetFriends ( ) ; $ approvedAtLeastOne = true ; } } } return $ approvedAtLeastOne ; }
Approve an incoming connection request.  AKA "approve request"

@param $model
@return bool
Approve an incoming connection request . AKA approve request