public function getWasPurchasedAttribute()
    {
        if (Auth::guest()) return false;
        return Auth::user()
            ->orders()
            ->whereSKU($this->attributes['sku'])
            ->whereStatusIn(config('shop.order_status_purchase'))
            ->count() > 0;
    }
public function getWasPurchasedAttribute()
    {
        if (Auth::guest()) return false;
        return Auth::user()
            ->orders()
            ->whereSKU($this->attributes['sku'])
            ->whereStatusIn(config('shop.order_status_purchase'))
            ->count() > 0;
    }
public function getWasPurchasedAttribute ( ) { if ( Auth :: guest ( ) ) return false ; return Auth :: user ( ) -> orders ( ) -> whereSKU ( $ this -> attributes [ 'sku' ] ) -> whereStatusIn ( config ( 'shop.order_status_purchase' ) ) -> count ( ) > 0 ; }
Returns flag indicating if item was purchased by user.

@return bool
Returns flag indicating if item was purchased by user .