{"id":20206567,"url":"https://github.com/useflyyer/flyyer-php","last_synced_at":"2025-04-10T12:33:08.280Z","repository":{"id":48798211,"uuid":"287740075","full_name":"useflyyer/flyyer-php","owner":"useflyyer","description":"PHP helpers to create https://flyyer.io URLs | Manage your og:image from a single dashboard","archived":false,"fork":false,"pushed_at":"2023-02-17T16:37:45.000Z","size":73,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T11:13:04.057Z","etag":null,"topics":["flyyer","image-generator","laravel","open-graph","php","seo","twitter-cards"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/flyyer/flyyer","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/useflyyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-15T12:13:21.000Z","updated_at":"2023-10-27T20:58:12.000Z","dependencies_parsed_at":"2024-11-14T05:25:05.375Z","dependency_job_id":"09734b48-2aed-4542-a039-95c1bf850ee5","html_url":"https://github.com/useflyyer/flyyer-php","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":0.2727272727272727,"last_synced_commit":"19d74a2c9d4de0de8459eb8720775a2560b91bb7"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/useflyyer","download_url":"https://codeload.github.com/useflyyer/flyyer-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217126,"owners_count":21066633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flyyer","image-generator","laravel","open-graph","php","seo","twitter-cards"],"created_at":"2024-11-14T05:24:56.805Z","updated_at":"2025-04-10T12:33:08.237Z","avatar_url":"https://github.com/useflyyer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flyyer-php\n\nThe AI-powered preview system built from your website (no effort required).\n\n![Flyyer live image](https://github.com/useflyyer/create-flyyer-app/blob/master/.github/assets/website-to-preview.png?raw=true\u0026v=1)\n\n**This package is agnostic to any PHP framework.**\n\n## Index\n\n- [Get started (5 minutes)](#get-started-5-minutes)\n- [Advanced usage](#advanced-usage)\n- [Flyyer Render](#flyyer-render)\n- [Development](#development)\n- [Test](#test)\n\n## Get started (5 minutes)\n\nHaven't registered your website yet? Go to [Flyyer.io](https://flyyer.io?ref=flyyer-php) and create a project (e.g. `website-com`).\n\n### 1. Install the library\n\nThis package supports PHP \u003e= 7.1.\n\n```sh\ncomposer require flyyer/flyyer\n```\n\n### 2. Get your Flyyer.io smart image link\n\nIn your website code (e.g. your landing or product/post view file), set the following:\n\n```php\n$flyyer = new Flyyer(\n  // Your project slug\n  'website-com',\n  // The current path of your website\n  '/path/to/product', // in Laravel 6 you can use `Route::getCurrentRoute()-\u003egetName()`\n);\n// (Optional, Recommended) Default or main image for each page\n$flyyer-\u003edefault = \"/static/image-1.png\" # or https://your-site.com/static/image-1.png\n\n\n// Check:\nprint($flyyer-\u003ehref());\n// \u003e https://cdn.flyyer.io/v2/website-com/_/__v=1618281823\u0026_def=%2Fstatic%2Fimage-1.png/path/to/product\n```\n\n### 3. Put your smart image link in your `\u003chead\u003e` tags\n\nYou'll get the best results like this:\n\n```php\n\u003cmeta property=\"og:image\" content=\"{{ $flyyer-\u003ehref() }} \"\u003e\n\u003cmeta name=\"twitter:image\" content=\"{{ $flyyer-\u003ehref() }} \"\u003e\n\u003cmeta name=\"twitter:card\" content=\"summary_large_image\"\u003e\n```\n\n### 4. Create a `rule` for your project\n\nGo to your dashboard [here](https://flyyer.io/dashboard/_/projects/_/manage) and create a rule like the following:\n\n[![Flyyer basic rule example](https://github.com/useflyyer/create-flyyer-app/blob/master/.github/assets/rule-example.png?raw=true\u0026v=1)](https://flyyer.io/dashboard)\n\nVoilà!\n\n## Advanced usage\n\nHere you have a detailed full example for project `website-com` and path `/path/to/product`.\n\nAdvanced features include:\n\n- 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](#flyyer-render)]\n- Custom metadata: set custom width, height, resolution, and more (see example).\n- Signed URLs.\n\n```php\n$flyyer = new Flyyer(\n  // [Required] Your project slug, find it in your dashboard https://www.flyyer.io/dashboard/_/projects/_/integrate.\n  'website-com',\n  // [Recommended] The current path of your website (by default it's `/`).\n  '/path/to/product',\n  // [Optional] In case you want to provide information that is not present in your page set it here.\n  [\n    'title' =\u003e 'Product name',\n    'img' =\u003e 'https://flyyer.io/img/marketplace/flyyer-banner.png'\n  ],\n  // [Optional] Custom metadata for rendering the image. ID is recommended so we provide you with better statistics.\n  [\n    'id' =\u003e 'jeans-123', // recommended for better stats\n    'v' =\u003e '12369420123', // specific handler version, by default it's a random number to circumvent platforms' cache,\n    'width' =\u003e 1200,\n    'height' =\u003e 600,\n    'resolution' =\u003e 0.9, // from 0.0 to 1.0\n    'agent' =\u003e 'whatsapp', // force dimensions for specific platform\n  ]);\n\n// Use this image in your \u003chead/\u003e tags (og:image \u0026 twitter:image)\nprint($flyyer-\u003ehref());\n// \u003e https://cdn.flyyer.io/v2/website-com/_/__id=jeans-123\u0026__v=1618281823\u0026img=https%3A%2F%2Fflyyer.io%2Fimg%2Fmarketplace%2Fflyyer-banner.png\u0026title=Product+name/path/to/product\n```\n\nFor signed URLs, just provide your secret (find it in Dashboard \u003e Project \u003e Advanced settings) and choose a strategy (`HMAC` or `JWT`).\n\n```php\n$flyyer = new Flyyer(\n  'website-com',\n  '/path/to/product',\n  [],\n  [ 'id' =\u003e 'jeans-123' ],\n  'your-secret-key',\n  'JWT', // or 'HMAC'\n);\n\n$url = $flyyer-\u003ehref();\n// \u003e https://cdn.flyyer.io/v2/website-com/jwt-eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXJhbXMiOnsiX19pZCI6ImplYW5zLTEyMyJ9LCJwYXRoIjoiXC9wYXRoXC90b1wvcHJvZHVjdCJ9.X8Vs5SGEA1-3M6bH-h24jhQnbwH95V_G0f-gPhTBTzE?__v=1618283086\n```\n\n## Flyyer Render\n\nAs you probably realized, **Flyyer** uses the [rules defined on your dashboard](https://flyyer.io/dashboard/_/projects) to decide how to handle every image based on path patterns. It analyses your website to obtain information and then render a content-rich image with no effort. Let's say _\"Flyyer delivers images based on the content of this route\"_.\n\n**Flyyer Render** instead requires you to explicitly declare template and variables for the images to render, **giving you more control for customization**. Let's say _\"FlyyerRender delivers an image using this template and these explicit variables\"_.\n\n```php\n$flyyer = new FlyyerRender(\"tenant\", \"deck\", \"template\");\n$flyyer-\u003evariables = [\n  \"title\" =\u003e \"Hello world!\"\n];\n\n// Use this image in your \u003chead/\u003e tags\n$url = $flyyer-\u003ehref();\n// \u003e https://cdn.flyyer.io/render/v2/tenant/deck/template.jpeg?__v=1596906866\u0026title=Hello+world%21\n```\n\nVariables can be complex arrays and objects.\n\n```php\n$flyyer-\u003evariables = [\n  \"items\" =\u003e [\n    [\"text\" =\u003e \"Oranges\", \"count\" =\u003e 12],\n    [\"text\" =\u003e \"Apples\", \"count\" =\u003e 14]\n  ]\n];\n```\n\n**IMPORTANT: variables must be serializable.**\n\nTo decode the URL for debugging purposes:\n\n```php\nprint(urldecode($url));\n// \u003e https://cdn.flyyer.io/render/v2/tenant/deck/template.jpeg?title=Hello+world!\u0026__v=123\n```\n\n## Development\n\nPrepare the local environment:\n\n```sh\ncomposer install\n```\n\n## Test\n\nRun PHPUnit with:\n\n```sh\ncomposer dump-autoload\ncomposer test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseflyyer%2Fflyyer-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuseflyyer%2Fflyyer-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseflyyer%2Fflyyer-php/lists"}