wearepixel/laravel-facebook-feed is a Laravel package for laravel facebook feed.
It currently has 0 GitHub stars and 2.090 downloads on Packagist (latest version 2.0.0).
Install it with composer require wearepixel/laravel-facebook-feed.
Discover more Laravel packages by wearepixel
or browse all Laravel packages to compare alternatives.
Last updated
A simple package to easily create an XML feed for the Facebook Catalog API 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.
composer require wearepixel/laravel-facebook-feed
use Wearepixel\LaravelFacebookFeed\LaravelFacebookFeed;
$feed = LaravelFacebookFeed::init(
title: 'My Store',
description: 'My store product feed',
link: 'https://mystore.com',
);
$feed->addItem([
'id' => 'item_001',
'title' => 'Blue Nikes',
'link' => 'https://mystore.com/products/blue-nikes',
'price' => '29.99 AUD',
'image_link' => 'https://mystore.com/images/blue-nikes-001.jpg',
]);
return $feed->generate();
| Field | Description |
| ------------ | ------------------------------------------------ |
| id | Unique product identifier |
| title | Product name |
| link | URL to the product page |
| price | Price including currency code (e.g. 29.99 AUD) |
| image_link | URL to the main product image |
Any additional fields supported by the Facebook Product Feed Specification can be passed alongside the required fields.
LaravelFacebookFeed::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.
composer test
MIT