Created
December 6, 2022 02:42
-
-
Save rmcdaniel/b24989aadde1f1a6341fb13a17d5ecf1 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
<?php | |
namespace App\Workflows\BuildPDF; | |
use Illuminate\Support\Facades\Http; | |
use Workflow\Activity; | |
class ConvertURLActivity extends Activity | |
{ | |
public function execute($url) | |
{ | |
$fileName = uniqid() . '.pdf'; | |
Http::withHeaders([ | |
'Apikey' => 'YOUR-API-KEY-GOES-HERE', | |
]) | |
->withOptions([ | |
'sink' => storage_path($fileName), | |
]) | |
->post('https://api.cloudmersive.com/convert/web/url/to/pdf', [ | |
'Url' => $url, | |
]); | |
return $fileName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment