PHP code example of soc-warden / laravel-sdk

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

    

soc-warden / laravel-sdk example snippets


use SOCWarden\Facades\SOCWarden;

SOCWarden::track('auth.login.success', [
    'actor_id' => $user->id,
    'actor_email' => $user->email,
]);

// bootstrap/app.php (Laravel 11+)
->withMiddleware(function (Middleware $middleware) {
    $middleware->append(\SOCWarden\Middleware\CaptureContext::class);
})
bash
php artisan vendor:publish --tag=socwarden-config