public function getDefaultPictureAttribute()
    {
        $default = $this->pictures->where('default', true)->first();

        if ($default) {
            return $default->path;
        }

        $picture = $this->pictures->first();

        if (is_null($picture)) {
            return 'images/no-image.jpg';
        }

        return $picture->path;
    }
public function getDefaultPictureAttribute()
    {
        $default = $this->pictures->where('default', true)->first();

        if ($default) {
            return $default->path;
        }

        $picture = $this->pictures->first();

        if (is_null($picture)) {
            return 'images/no-image.jpg';
        }

        return $picture->path;
    }
public function getDefaultPictureAttribute ( ) { $ default = $ this -> pictures -> where ( 'default' , true ) -> first ( ) ; if ( $ default ) { return $ default -> path ; } $ picture = $ this -> pictures -> first ( ) ; if ( is_null ( $ picture ) ) { return 'images/no-image.jpg' ; } return $ picture -> path ; }
Returns the product default picture.

@return string
Returns the product default picture .