flowframe / laravel-previewify
The official Laravel client for Previewify
This package's canonical repository appears to be gone and the package has been frozen as a result.
Fund package maintenance!
larsklopstra
Installs: 2 607
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 3
Requires
- php: ^8.0
- illuminate/contracts: ^8.73|^9.0|^10.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^5.10|^6.0|^7.0
- nunomaduro/larastan: ^1.0
- orchestra/testbench: ^6.22|^7.0|^8.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5|^10.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-08-09 21:59:26 UTC
README
This is the official Previewify client for Laravel.
Installation
You can install the package via Composer:
composer require flowframe/laravel-previewify
Usage
Configuration
You can set an API token in your .env
by using PREVIEWIFY_API_TOKEN
.
return [ /** * Previewify API token * * Obtain one from https://previewify.app/app/account */ 'api_token' => env('PREVIEWIFY_API_TOKEN'), ];
Methods
use Flowframe\Previewify\Previewify; /** @var Previewify $previewify */ $previewify = app(Previewify::class); $sites = $previewify->listSites(); $site = $previewify->showSite(siteId: 1); $siteTemplates = $previewify->listSiteTemplates(siteId: 1); // This will return a JSON response with the image URL, the request may take 4 to 8 seconds to complete $downloadableImageUrl = $previewify->downloadImage(siteId: 1, templateId: 1, fields: [ 'previewify:title' => 'Hello from Laravel', 'previewify:cta' => 'This is an example', ]); // This method makes no API requests, we advise to use this over `downloadImage` $signedImageUrl = $previewify->signedImageUrl(templateId: 1, [ 'previewify:title' => 'Hello from Laravel', 'previewify:cta' => 'This is an example', ]);
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.