Download the PHP package wearepixel/laravel-google-shopping-feed without Composer
On this page you can find all versions of the php package wearepixel/laravel-google-shopping-feed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wearepixel/laravel-google-shopping-feed
More information about wearepixel/laravel-google-shopping-feed
Files in wearepixel/laravel-google-shopping-feed
Package laravel-google-shopping-feed
Short Description Laravel Google Shopping Feed
License MIT
Homepage https://github.com/wearepixel/laravel-google-shopping-feed
Informations about the package laravel-google-shopping-feed
A simple package to easily create an XML feed for Google Merchant Center to parse and retrieve your products.
We recommend adding this to an API controller and generating it on the fly so your feed is always up to date.
Requirements
- PHP 8.4+
- Laravel 10, 11, or 12
Installation
Usage
Required item fields
| Field | Description |
|---|---|
id |
Unique product identifier |
title |
Product name |
link |
URL to the product page |
g:price |
Price including currency code (e.g. 29.99 AUD) |
g:image_link |
URL to the main product image |
Any additional fields supported by the Google Product Data Specification can be passed alongside the required fields.
Methods
LaravelGoogleShoppingFeed::init(string $title, string $description, string $link): static
Creates a new feed instance with channel metadata.
$feed->addItem(array $item): void
Adds a product to the feed. Throws MissingRequiredFieldException if any required field is absent.
$feed->toXml(): string
Returns the feed as an XML string.
$feed->generate(): Response
Returns an HTTP response with the XML content and application/rss+xml content type. Suitable for returning directly from a controller.
Testing
License
MIT
All versions of laravel-google-shopping-feed with dependencies
spatie/array-to-xml Version 2.8.*|3.*
illuminate/support Version 10.*|11.*|12.*|13.*