QuoteMaker is simple library to create quote image
composer require masokky/quotemaker
If you won't use composer, click here with the simple installation
<?php
require "./vendor/autoload.php";
use masokky\QuoteMaker;
try{
$text = "the cruelest crime is giving false hope without love";
(new QuoteMaker)
->setBackgroundFromUnsplash(["b353e61a07cc0068080258kc0294ks85042f2560d6223366500a2aa30ff28052"],"heart")
->quoteText($text)
->watermarkText("Mas Okky")
->toFile("result.jpg");
}catch(Exception $e){
echo $e->getMessage();
}
$path
(string) - Location of background image
You can search and use image from unsplash.com
Before use this function, you should create app to get "client_id" for accessing the API
Because there is a limit per hour for each "client_id", so you can add two or more "client_id" to increase the limit
$client_id
(array) - The access key of unsplash app$keyword
(string) - Keyword to search an image, defaultrandom
$text
(string) - Set the quote text. Use\n
to add line break
$path
(string) - Set the custom quote font*
$size
(int) - Set the custom quote font size*
$text
(string) - Set the watermark text, defaultnull
$path
(string) - Set the custom watermark font*
$size
(int) - Set the custom watermark font size*
Output the result to the screen
Save the result to image file
*Default see the example result
Feel free to develop and maintain this library