src/Models/Database/Product.php
public function getProductAllAttributes($variation = null)
    {
        if (null === $variation) {
            $variations = $this->productVariations()->get();
        }

        $collection = Collection::make([]);

        if (null === $variations || $variations->count() <= 0) {
            return $collection;
        }

        foreach ($variations as $variation) {
            $variationModel = self::findorfail($variation->variation_id);

            foreach ($variationModel->productVarcharAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productBooleanAttributes as $item) {
                $collection->push($item);
            }

            foreach ($variationModel->productTextAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productDecimalAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productDecimalAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productIntegerAttributes as $item) {
                $collection->push($item);
            }

            foreach ($variationModel->productDatetimeAttributes as $item) {
                $collection->push($item);
            }
        }

        return $collection;
    }
public function getProductAllAttributes($variation = null)
    {
        if (null === $variation) {
            $variations = $this->productVariations()->get();
        }

        $collection = Collection::make([]);

        if (null === $variations || $variations->count() <= 0) {
            return $collection;
        }

        foreach ($variations as $variation) {
            $variationModel = self::findorfail($variation->variation_id);

            foreach ($variationModel->productVarcharAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productBooleanAttributes as $item) {
                $collection->push($item);
            }

            foreach ($variationModel->productTextAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productDecimalAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productDecimalAttributes as $item) {
                $collection->push($item);
            }
            foreach ($variationModel->productIntegerAttributes as $item) {
                $collection->push($item);
            }

            foreach ($variationModel->productDatetimeAttributes as $item) {
                $collection->push($item);
            }
        }

        return $collection;
    }
public function getProductAllAttributes ( $ variation = null ) { if ( null === $ variation ) { $ variations = $ this -> productVariations ( ) -> get ( ) ; } $ collection = Collection :: make ( [ ] ) ; if ( null === $ variations || $ variations -> count ( ) <= 0 ) { return $ collection ; } foreach ( $ variations as $ variation ) { $ variationModel = self :: findorfail ( $ variation -> variation_id ) ; foreach ( $ variationModel -> productVarcharAttributes as $ item ) { $ collection -> push ( $ item ) ; } foreach ( $ variationModel -> productBooleanAttributes as $ item ) { $ collection -> push ( $ item ) ; } foreach ( $ variationModel -> productTextAttributes as $ item ) { $ collection -> push ( $ item ) ; } foreach ( $ variationModel -> productDecimalAttributes as $ item ) { $ collection -> push ( $ item ) ; } foreach ( $ variationModel -> productDecimalAttributes as $ item ) { $ collection -> push ( $ item ) ; } foreach ( $ variationModel -> productIntegerAttributes as $ item ) { $ collection -> push ( $ item ) ; } foreach ( $ variationModel -> productDatetimeAttributes as $ item ) { $ collection -> push ( $ item ) ; } } return $ collection ; }
Get All Attribute for the Product.

@param $variation
@return \Illuminate\Support\Collection
Get All Attribute for the Product .