PHP code example of placidapp / placid-laravel

1. Go to this page and download the library: Download placidapp/placid-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

placidapp / placid-laravel example snippets


$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


 $image = $template->image();

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

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

$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

$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

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

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

    /**
     * Placid Success Webhook
     *
     * Will be called when your created image is ready
     */
    'webhook_url' => null
];
bash
php artisan vendor:publish --provider="Placid\Laravel\PlacidLaravelServiceProvider" --tag="config"