✨ Automatic image creation from templates

Overview

Placid for Laravel - Automatic image creation from templates

Placid for Laravel

Latest Version Total Downloads MadeWithLaravel.com shield

This package enables you to automatically create images from Placid templates. You can use the REST API or the URL API to create placid.app embed links with your variables to dynamically set the image content.

About Placid

To use this package, you will need a Placid account, where you can add, design and edit image templates.

It is a service that automatically creates share images for your content: Open Graph images (og:images), Twitter Card images and Pinterest images. This saves you hours to make your content shareable after publishing. We offer a bunch of nice preset designs you can use out of the box as well.

More than share images: With our editor you have full control over your templates, so you can use it for other types of images to add to your content as well (like teasers or blog graphics).

Create a placid.app image URL

elementText($title) ->text("I am a dynamic image"); $imageURL = $template->toPlacidUrl(); // - https://placid.app/u/qsraj?title=I%20am%20a%20dynamic%20Image%21 ">
$templateId = "qsraj";

$template = Placid::template($templateId)
$template
    ->elementText($title)
    ->text("I am a dynamic image");

$imageURL = $template->toPlacidUrl(); // - https://placid.app/u/qsraj?title=I%20am%20a%20dynamic%20Image%21

Dynamically created image with Placid

Generate an Image

Using the image() function on the template object will result in returning a GeneratedImage Object. When the image has been created, the webhook defined in your config will be called!

 $image = $template->image();

image(true) will wait for the image to being finished:

 $image = $template->image(true); // - https://placid.app/u/qsraj?title=I%20am%20a%20dynamic%20Image%21

Fields

You can add different elements onto your template that can be changed and filled dynamically.

Text field

text("This is the text") ->color('#ff0022'); // - Text color as hex-code ">
$template
    ->elementText("text") // - Layer name in your template
    ->text("This is the text")
    ->color('#ff0022'); // - Text color as hex-code

PLEASE NOTE: The text color can only be changed when you use the image() function to generate an image, not if you use the URL API.

Picture field

elementPicture('picture') // - Layer name in your template ->imageFromWebsite("https://madewithvuejs.com"); // - URL of a page to screenshot ">
$template
    ->elementPicture('picture') // - Layer name in your template
    ->imageFromUrl(
        "https://madewithvuejs.com/mandant/madewithvuejs/images/logo.png" // - image source
    );

$template
    ->elementPicture('picture') // - Layer name in your template
    ->imageFromWebsite("https://madewithvuejs.com"); // - URL of a page to screenshot

Browserframe field

url("madewithvuejs.com"); // - URL that will be displayed in the browserframe's address bar $template ->elementBrowserframe('browserframe') // - Layer name in your template ->imageFromWebsite("https://madewithvuejs.com") // - URL of a page to screenshot ->url("madewithvuejs.com"); // - URL that will be displayed in the browserframe's address bar ">
$template
    ->elementBrowserframe('browserframe') // - Layer name in your template
    ->imageFromUrl(
        "https://madewithvuejs.com/mandant/madewithvuejs/images/logo.png" // - image source 
    )
    ->url("madewithvuejs.com"); // - URL that will be displayed in the browserframe's address bar

$template
    ->elementBrowserframe('browserframe') // - Layer name in your template
    ->imageFromWebsite("https://madewithvuejs.com") // - URL of a page to screenshot
    ->url("madewithvuejs.com"); // - URL that will be displayed in the browserframe's address bar

Rectangle field

$template
    ->elementRectangle('rectangle') // - Layer name in your template
    ->backgroundColor("#000000"); // - Background color as hex-code

PLEASE NOTE: The background color can only be changed when you use the image() function to generate an image, not if you use the URL API.

Installation

You can install this package via composer using this command:

composer require "placidapp/placid-laravel:^1.0.0"

The package will automatically register itself.

You can publish the config-file with:

php artisan vendor:publish --provider="Placid\Laravel\PlacidLaravelServiceProvider" --tag="config"

These are the contents of the published config file:

return [
    /**
     * Placid API Token
     */
    'api-token' => null,

    /**
     * Placid Success Webhook
     *
     * Will be called when your created image is ready
     */
    'webhook_url' => null
];

License

The MIT License (MIT). Please see License File for more information.

You might also like...
Extract colors from an image like a human would do.

ColorExtractor Extract colors from an image like a human would do. Install Via Composer $ composer require league/color-extractor:0.3.* Usage require

 An open source image hosting service powered by Laravel
An open source image hosting service powered by Laravel

Limg An open source image hosting service powered by Laravel Features Upload your image via file, url or ShareX ! Manage your image (custom title, pub

A simple page view counter that store data as text and shows data as a PNG image

Image Counter A simple page view counter that store data as text and shows the counter as a PNG image.

Grabs the dominant color or a representative color palette from an image. Uses PHP and GD, Imagick or Gmagick.

Color Thief PHP A PHP class for grabbing the color palette from an image. Uses PHP and GD or Imagick libraries to make it happen. It's a PHP port of t

PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options !
PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options !

PHP Image Editor PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options ! ✨ Supporting ⭐ Star this repos

image sharing site made in PHP just for fun and freetime
image sharing site made in PHP just for fun and freetime

2bart image sharing site made in PHP just for fun and freetime To-do list: upload system [DONE] ✔️ views system [DONE] ✔️ image list system [DONE] ✔️

Convert image types. Take samples of pdfs or psd, do some filters as SEPIA, resizes. Save to WEBP
Convert image types. Take samples of pdfs or psd, do some filters as SEPIA, resizes. Save to WEBP

img2img. PHP Converter, sampler of pdfs & psd, do resizes & some filters in images as SEPIA. Save to WEBP V.1.0.3 This class in pure PHP try to manage

Alternative image provider for fakerphp using picsum.photos

Fakerphp Picsum Images Introduction Alternative image provider for fakerphp using picsum.photos This package has been forked from mmo/faker-images for

Picasso is a Laravel Image Management and Optimization Package

Picasso is a Laravel Image Management and Optimization Package. Define image dimensions and options, store uploaded image in multiple dimensions with or without a watermark and retrieve optimized images on your website when needed.

Comments
  • Add php ^8.0 support & drop EOL versions

    Add php ^8.0 support & drop EOL versions

    • Add PHP ^8.0 support
    • Remove empty require-dev
    • Fix critical non-existing functions and uses

    Reference of EOL versions: https://www.php.net/supported-versions.php

    Important: Before merge, be sure you merged https://github.com/placidapp/placid-php/pull/2 before this PR.

    opened by ghostzero 0
Releases(v1.0.1)
php-gd based image templates

gdaisy A highly experimental image templating system based on PHP-GD to dynamically generate image banners and covers. Installation 1. Require erikahe

Erika Heidi 67 Nov 22, 2022
Auto Image & file upload, resize and crop for Laravel eloquent model using Intervention image

Laravel ImageUp The qcod/laravel-imageup is a trait which gives you auto upload, resize and crop for image feature with tons of customization. Install

QCode.in 708 Dec 22, 2022
A Laravel Gravatar package for retrieving gravatar image URLs or checking the existance of an image.

Gravatar for Laravel 5.x, 6, 7 and 8 Installation First, pull in the package through Composer via the command line: composer require creativeorange/gr

Creativeorange 477 Dec 1, 2022
This plugin adds a new image style for the Core Image block.

This plugin adds a new image style for the Core Image block. Introduction How to use? Go to Gutenberg Editor and add a image block. e.g. Add new image

Mahesh Waghmare 3 Feb 17, 2022
PHP Image Manipulation

Intervention Image Intervention Image is a PHP image handling and manipulation library providing an easier and expressive way to create, edit, and com

null 13k Jan 3, 2023
PHP 5.3 Object Oriented image manipulation library

Imagine Tweet about it using the #php_imagine hashtag. Image manipulation library for PHP 5.3 inspired by Python's PIL and other image libraries. Requ

Bulat Shakirzyanov 4.3k Jan 6, 2023
Wonderfully easy on-demand image manipulation library with an HTTP based API.

Glide Glide is a wonderfully easy on-demand image manipulation library written in PHP. Its straightforward API is exposed via HTTP, similar to cloud i

The League of Extraordinary Packages 2.4k Dec 19, 2022
🌄 Perceptual image hashing for PHP

ImageHash A perceptual hash is a fingerprint of a multimedia file derived from various features from its content. Unlike cryptographic hash functions

Jens Segers 1.9k Dec 28, 2022
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.

Image Optimizer This library is handy and very easy to use optimizer for image files. It uses optipng, pngquant, jpegoptim, svgo and few more librarie

Piotr Śliwa 879 Dec 30, 2022
:racehorse: find the size of an image without downloading the whole file. Supports batch requests.

FasterImage FasterImage finds the dimensions or filetype of a remote image file given its uri by fetching as little as needed, based on the excellent

Will Washburn 58 Nov 30, 2022