PHP code example of gridwb / laravel-funnelfox

1. Go to this page and download the library: Download gridwb/laravel-funnelfox 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/ */

    

gridwb / laravel-funnelfox example snippets




use Gridwb\LaravelFunnelFox\Facades\FunnelFox;

$profileId = '<string>';

$response = FunnelFox::profiles()->getProfile($profileId);

echo $response->id;
echo $response->createdAt;
echo $response->funnelId;
echo $response->preview;
echo $response->email;

// Adapty integration
echo $response->integrations->adapty?->entitlement;
echo $response->integrations->adapty?->userId;

// RevenueCat integration
echo $response->integrations->adapty?->entitlement;
echo $response->integrations->adapty?->userId;



use Gridwb\LaravelFunnelFox\Facades\FunnelFox;

$response = FunnelFox::profiles()->listProfiles([
    'limit' => 20,
    'cursor' => '<string>',
    'filter' => [
        'email' => '<string>',
        'funnel_id' => '<string>',
    ],
]);

foreach ($response->data as $profile) {
    echo $profile->id;
    echo $profile->createdAt;
    echo $profile->preview;
    echo $profile->email;
    echo $profile->country;
    echo $profile->funnelId;
}

echo $response->pagination->hasMore;
echo $response->pagination->total;
echo $response->pagination->nextCursor;



use Gridwb\LaravelFunnelFox\Events\OnboardingStarted;
use Illuminate\Support\Facades\Event;

Event::listen(OnboardingStarted::class, function (OnboardingStarted $event) {
    $payload = $event->payload;
    // Access data from FunnelFox payload
});
bash
    php artisan vendor:publish --tag="funnelfox-config"