Last active
October 22, 2021 09:40
-
-
Save BjornDCode/29d651221f098e0ebf8110daeedf88ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Open graph --> | |
@php | |
$form = $page['props']['form']; | |
$backgroundColor = urlencode($form->branding->primary_color); // $form->branding->primary_color is a hex string e.g '#333333' | |
$title = urlencode($form->name); | |
if (!is_null($form->branding->logo)) { | |
$image = urlencode($form->branding->logo); | |
$ogImage = "https://api.placid.app/u/xcqiqw9tj?Background[background_color]={$backgroundColor}&FormName[text]={$title}&Logo[image]={$image}"; | |
} else { | |
$ogImage = "https://api.placid.app/u/3uugfu8j8?Background[background_color]={$backgroundColor}&FormName[text]={$title}"; | |
} | |
@endphp | |
<meta property="og:image" content="{{ $ogImage }}"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment