### Install laravel-zapier via Composer Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Install the package via Composer. ```bash composer require jeffersongoncalves/laravel-zapier ``` -------------------------------- ### Manage Zaps with Zapier facade Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Manage Zaps: list, inspect, enable, disable, read task history, and get the authenticated profile. ```php Zapier::zaps(); // list every Zap Zapier::zap('123456'); // a single Zap Zapier::enableZap('123456'); // turn it on Zapier::disableZap('123456');// turn it off Zapier::tasks('123456'); // task history for a Zap Zapier::profile(); // the authenticated account ``` -------------------------------- ### Run laravel-zapier tests Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Run the package test suite. ```bash composer test ``` -------------------------------- ### Dependency injection of Zapier client Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Inject the Zapier client as a singleton instead of using the facade. ```php use JeffersonGoncalves\Zapier\Zapier; public function __construct(protected Zapier $zapier) {} ``` -------------------------------- ### Publish laravel-zapier config Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Publish the package configuration file. ```bash php artisan vendor:publish --tag=laravel-zapier-config ``` -------------------------------- ### Send to named catch hook from config Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Define named hooks in config/zapier.php and send to them by name, keeping URLs out of code. ```php // config/zapier.php 'hooks' => [ 'new-lead' => env('ZAPIER_HOOK_NEW_LEAD'), ], ``` ```php Zapier::send('new-lead', ['email' => 'ada@example.com']); ``` -------------------------------- ### Set ZAPIER_API_KEY in .env Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Add the Zapier API key to your .env file. Required only for REST API calls; sending to catch hooks works without it. ```dotenv ZAPIER_API_KEY=your-zapier-api-key ``` -------------------------------- ### Queue Zapier send with dispatch Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Fire and forget from a queue so the request does not block a web response. ```php dispatch(fn () => Zapier::send('new-lead', ['email' => $user->email])); ``` -------------------------------- ### Fake Zapier HTTP calls in tests Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Fake HTTP requests to hooks.zapier.com in tests using Laravel's HTTP client. ```php use Illuminate\Support\Facades\Http; Http::fake(['hooks.zapier.com/*' => Http::response(['status' => 'success'])]); ``` -------------------------------- ### Send payload to Zapier catch hook by URL Source: https://github.com/jeffersongoncalves/laravel-zapier/blob/main/README.md Send data to a Zapier catch hook by URL. Requires a 'Webhooks by Zapier → Catch Hook' trigger in Zapier. ```php use JeffersonGoncalves\Zapier\Facades\Zapier; Zapier::send('https://hooks.zapier.com/hooks/catch/123456/abcdef', [ 'name' => 'Ada Lovelace', 'email' => 'ada@example.com', ]); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.