flyyer-php
The AI-powered preview system built from your website (no effort required).
This package is agnostic to any PHP framework.
Index
- Get started (5 minutes)
- Advanced usage
- Flyyer Render
- Development
- Test
Get started (5 minutes)
Haven't registered your website yet? Go to Flyyer.io and create a project (e.g. website-com).
1. Install the library
This package supports PHP >= 7.1.
2. Get your Flyyer.io smart image link
In your website code (e.g. your landing or product/post view file), set the following:
// Your project slug
'website-com',
// The current path of your website
'/path/to/product', // in Laravel 6 you can use `Route::getCurrentRoute()->getName()`
);
// (Optional, Recommended) Default or main image for each page
$flyyer->default = "/static/image-1.png" # or https://your-site.com/static/image-1.png
// Check:
print($flyyer->href());
// > https://cdn.flyyer.io/v2/website-com/_/__v=1618281823&_def=%2Fstatic%2Fimage-1.png/path/to/product
3. Put your smart image link in your tags
You'll get the best results like this:
"twitter:image" content="{{ $flyyer->href() }} ">
"twitter:card" content="summary_large_image">
4. Create a rule for your project
Go to your dashboard here and create a rule like the following:
Voila!
Advanced usage
Here you have a detailed full example for project website-com and path /path/to/product.
Advanced features include:
- Custom variables: additional information for your preview that is not present in your website. [Note: if you need customization you should take a look at Flyyer Render]
- Custom metadata: set custom width, height, resolution, and more (see example).
- Signed URLs.
// [Required] Your project slug, find it in your dashboard https://www.flyyer.io/dashboard/_/projects/_/integrate.
'website-com',
// [Recommended] The current path of your website (by default it's `/`).
'/path/to/product',
// [Optional] In case you want to provide information that is not present in your page set it here.
[
'title' => 'Product name',
'img' => 'https://flyyer.io/img/marketplace/flyyer-banner.png'
],
// [Optional] Custom metadata for rendering the image. ID is recommended so we provide you with better statistics.
[
'id' => 'jeans-123', // recommended for better stats
'v' => '12369420123', // specific handler version, by default it's a random number to circumvent platforms' cache,
'width' => 1200,
'height' => 600,
'resolution' => 0.9, // from 0.0 to 1.0
'agent' => 'whatsapp', // force dimensions for specific platform
]);
// Use this image in your tags (og:image & twitter:image)
print($flyyer->href());
// > https://cdn.flyyer.io/v2/website-com/_/__id=jeans-123&__v=1618281823&img=https%3A%2F%2Fflyyer.io%2Fimg%2Fmarketplace%2Fflyyer-banner.png&title=Product+name/path/to/product