Compare commits

..
7 Commits
Author SHA1 Message Date
Joel Male f9dcce39b9 chore: support Laravel 10 & 11 2024-01-08 09:26:53 +10:00
Joel Male a7e22e8fce update price to g:price as per google changes 2023-01-06 09:28:12 +10:00
Joel Male 5a1c822810 bump version 2023-01-03 14:50:47 +10:00
Joel Male fb85d49e88 update google image field as per latest google update 2023-01-03 14:45:20 +10:00
Joel Male b08e9943b8 chore: update version 2022-06-29 09:05:53 +10:00
Joel Male 01ac326a54 chore: update version 2022-06-29 09:05:00 +10:00
Joel Male ebac71996c chore: fix adding additional attributes 2022-06-29 08:58:24 +10:00
4 changed files with 129 additions and 80 deletions
+2 -2
View File
@@ -25,8 +25,8 @@ ## Example
'id' => 'item_001', 'id' => 'item_001',
'title' => 'Blue Nikes', 'title' => 'Blue Nikes',
'link' => 'https://mystore.com/products/blue-nikes', 'link' => 'https://mystore.com/products/blue-nikes',
'image_link' => 'https://mystore.com/images/blue-nikes-001.jpg', 'g:image_link' => 'https://mystore.com/images/blue-nikes-001.jpg',
'price' => 29.99, 'g:price' => 29.99,
]); ]);
return $feed->generate(); return $feed->generate();
+2 -2
View File
@@ -6,7 +6,7 @@
"laravel", "laravel",
"google-shopping-feed" "google-shopping-feed"
], ],
"version": "1.0.0", "version": "4.0.0",
"homepage": "https://github.com/wearepixel/laravel-google-shopping-feed", "homepage": "https://github.com/wearepixel/laravel-google-shopping-feed",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
@@ -20,7 +20,7 @@
}, },
"require": { "require": {
"spatie/array-to-xml": "2.8.*|3.*.*", "spatie/array-to-xml": "2.8.*|3.*.*",
"illuminate/support": "8.*|9.*" "illuminate/support": "8.*|9.*|10.*|11.*"
}, },
"prefer-stable": true "prefer-stable": true
} }
Generated
+119 -66
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "9c35a7c4f9aa99b0d5c443793936150d", "content-hash": "610b63c1c2a0df4f458d7f5c5498b537",
"packages": [ "packages": [
{ {
"name": "doctrine/inflector", "name": "doctrine/inflector",
@@ -99,30 +99,31 @@
}, },
{ {
"name": "illuminate/collections", "name": "illuminate/collections",
"version": "v8.83.15", "version": "v9.16.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/collections.git", "url": "https://github.com/illuminate/collections.git",
"reference": "fc232e89c0214dba5d2b431220a24b02d480a472" "reference": "5aac36506247e4f0e50afe815ba711c16e65bcef"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/collections/zipball/fc232e89c0214dba5d2b431220a24b02d480a472", "url": "https://api.github.com/repos/illuminate/collections/zipball/5aac36506247e4f0e50afe815ba711c16e65bcef",
"reference": "fc232e89c0214dba5d2b431220a24b02d480a472", "reference": "5aac36506247e4f0e50afe815ba711c16e65bcef",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"illuminate/contracts": "^8.0", "illuminate/conditionable": "^9.0",
"illuminate/macroable": "^8.0", "illuminate/contracts": "^9.0",
"php": "^7.3|^8.0" "illuminate/macroable": "^9.0",
"php": "^8.0.2"
}, },
"suggest": { "suggest": {
"symfony/var-dumper": "Required to use the dump method (^5.4)." "symfony/var-dumper": "Required to use the dump method (^6.0)."
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "8.x-dev" "dev-master": "9.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -149,31 +150,77 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2022-03-25T14:53:23+00:00" "time": "2022-05-30T13:16:45+00:00"
}, },
{ {
"name": "illuminate/contracts", "name": "illuminate/conditionable",
"version": "v8.83.15", "version": "v9.16.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/contracts.git", "url": "https://github.com/illuminate/conditionable.git",
"reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d" "reference": "46b7beed47948bd2e67f523d0a76daa62775031e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/contracts/zipball/5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", "url": "https://api.github.com/repos/illuminate/conditionable/zipball/46b7beed47948bd2e67f523d0a76daa62775031e",
"reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", "reference": "46b7beed47948bd2e67f523d0a76daa62775031e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.3|^8.0", "php": "^8.0.2"
"psr/container": "^1.0",
"psr/simple-cache": "^1.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "8.x-dev" "dev-master": "9.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Support\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Conditionable package.",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2022-05-31T14:47:50+00:00"
},
{
"name": "illuminate/contracts",
"version": "v9.16.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/contracts.git",
"reference": "e354ef98f3c59e5c8b5ba87299999220270f3da5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/contracts/zipball/e354ef98f3c59e5c8b5ba87299999220270f3da5",
"reference": "e354ef98f3c59e5c8b5ba87299999220270f3da5",
"shasum": ""
},
"require": {
"php": "^8.0.2",
"psr/container": "^1.1.1|^2.0.1",
"psr/simple-cache": "^1.0|^2.0|^3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "9.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -197,29 +244,29 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2022-01-13T14:47:47+00:00" "time": "2022-04-28T13:05:07+00:00"
}, },
{ {
"name": "illuminate/macroable", "name": "illuminate/macroable",
"version": "v8.83.15", "version": "v9.16.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/macroable.git", "url": "https://github.com/illuminate/macroable.git",
"reference": "aed81891a6e046fdee72edd497f822190f61c162" "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", "url": "https://api.github.com/repos/illuminate/macroable/zipball/25a2c6dac2b7541ecbadef952702e84ae15f5354",
"reference": "aed81891a6e046fdee72edd497f822190f61c162", "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.3|^8.0" "php": "^8.0.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "8.x-dev" "dev-master": "9.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -243,48 +290,49 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2021-11-16T13:57:03+00:00" "time": "2022-02-01T14:44:21+00:00"
}, },
{ {
"name": "illuminate/support", "name": "illuminate/support",
"version": "v8.83.15", "version": "v9.16.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/support.git", "url": "https://github.com/illuminate/support.git",
"reference": "89245b6e19017f627a35af3874ad9251b76b02cc" "reference": "f87ac1cc6dd3f9f03c9f7b48c7d94b7a53933a0a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/support/zipball/89245b6e19017f627a35af3874ad9251b76b02cc", "url": "https://api.github.com/repos/illuminate/support/zipball/f87ac1cc6dd3f9f03c9f7b48c7d94b7a53933a0a",
"reference": "89245b6e19017f627a35af3874ad9251b76b02cc", "reference": "f87ac1cc6dd3f9f03c9f7b48c7d94b7a53933a0a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/inflector": "^1.4|^2.0", "doctrine/inflector": "^2.0",
"ext-json": "*", "ext-json": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"illuminate/collections": "^8.0", "illuminate/collections": "^9.0",
"illuminate/contracts": "^8.0", "illuminate/conditionable": "^9.0",
"illuminate/macroable": "^8.0", "illuminate/contracts": "^9.0",
"illuminate/macroable": "^9.0",
"nesbot/carbon": "^2.53.1", "nesbot/carbon": "^2.53.1",
"php": "^7.3|^8.0", "php": "^8.0.2",
"voku/portable-ascii": "^1.6.1" "voku/portable-ascii": "^2.0"
}, },
"conflict": { "conflict": {
"tightenco/collect": "<5.5.33" "tightenco/collect": "<5.5.33"
}, },
"suggest": { "suggest": {
"illuminate/filesystem": "Required to use the composer class (^8.0).", "illuminate/filesystem": "Required to use the composer class (^9.0).",
"league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).",
"ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).",
"symfony/process": "Required to use the composer class (^5.4).", "symfony/process": "Required to use the composer class (^6.0).",
"symfony/var-dumper": "Required to use the dd function (^5.4).", "symfony/var-dumper": "Required to use the dd function (^6.0).",
"vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)."
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "8.x-dev" "dev-master": "9.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -311,7 +359,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2022-05-09T16:28:53+00:00" "time": "2022-06-02T14:10:45+00:00"
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
@@ -412,22 +460,27 @@
}, },
{ {
"name": "psr/container", "name": "psr/container",
"version": "1.1.2", "version": "2.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/container.git", "url": "https://github.com/php-fig/container.git",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea" "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.4.0" "php": ">=7.4.0"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Psr\\Container\\": "src/" "Psr\\Container\\": "src/"
@@ -454,31 +507,31 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-fig/container/issues", "issues": "https://github.com/php-fig/container/issues",
"source": "https://github.com/php-fig/container/tree/1.1.2" "source": "https://github.com/php-fig/container/tree/2.0.2"
}, },
"time": "2021-11-05T16:50:12+00:00" "time": "2021-11-05T16:47:00+00:00"
}, },
{ {
"name": "psr/simple-cache", "name": "psr/simple-cache",
"version": "1.0.1", "version": "3.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/simple-cache.git", "url": "https://github.com/php-fig/simple-cache.git",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.0" "php": ">=8.0.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.0.x-dev" "dev-master": "3.0.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -493,7 +546,7 @@
"authors": [ "authors": [
{ {
"name": "PHP-FIG", "name": "PHP-FIG",
"homepage": "http://www.php-fig.org/" "homepage": "https://www.php-fig.org/"
} }
], ],
"description": "Common interfaces for simple caching", "description": "Common interfaces for simple caching",
@@ -505,9 +558,9 @@
"simple-cache" "simple-cache"
], ],
"support": { "support": {
"source": "https://github.com/php-fig/simple-cache/tree/master" "source": "https://github.com/php-fig/simple-cache/tree/3.0.0"
}, },
"time": "2017-10-23T01:57:42+00:00" "time": "2021-10-29T13:26:27+00:00"
}, },
{ {
"name": "spatie/array-to-xml", "name": "spatie/array-to-xml",
@@ -917,16 +970,16 @@
}, },
{ {
"name": "voku/portable-ascii", "name": "voku/portable-ascii",
"version": "1.6.1", "version": "2.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/voku/portable-ascii.git", "url": "https://github.com/voku/portable-ascii.git",
"reference": "87337c91b9dfacee02452244ee14ab3c43bc485a" "reference": "b56450eed252f6801410d810c8e1727224ae0743"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a", "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743",
"reference": "87337c91b9dfacee02452244ee14ab3c43bc485a", "reference": "b56450eed252f6801410d810c8e1727224ae0743",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -963,7 +1016,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/voku/portable-ascii/issues", "issues": "https://github.com/voku/portable-ascii/issues",
"source": "https://github.com/voku/portable-ascii/tree/1.6.1" "source": "https://github.com/voku/portable-ascii/tree/2.0.1"
}, },
"funding": [ "funding": [
{ {
@@ -987,7 +1040,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-01-24T18:55:24+00:00" "time": "2022-03-08T17:03:00+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],
+6 -10
View File
@@ -18,8 +18,8 @@ class LaravelGoogleShoppingFeed
'id', 'id',
'link', 'link',
'title', 'title',
'price', 'g:price',
'image_link' 'g:image_link'
]; ];
public static function init($title = null, $description = null, $link = null) public static function init($title = null, $description = null, $link = null)
@@ -41,13 +41,9 @@ public function addItem(array $item): bool
} }
} }
$product = [ foreach ($item as $key => $value) {
'id' => $item['id'], $product[$key] = $value;
'link' => $item['link'], }
'title' => $item['title'],
'price' => $item['price'],
'image_link' => $item['image_link'],
];
$this->products[] = $product; $this->products[] = $product;
@@ -57,7 +53,7 @@ public function addItem(array $item): bool
public function generate() public function generate()
{ {
$this->xml = [ $this->xml = [
'rss' => [ 'rss' => [
'_attributes' => [ '_attributes' => [
'xmlns:g' => 'http://base.google.com/ns/1.0', 'xmlns:g' => 'http://base.google.com/ns/1.0',
'version' => '2.0', 'version' => '2.0',