Skip to content

Instantly share code, notes, and snippets.

@yatsenkolesh
Last active June 23, 2022 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yatsenkolesh/a63d4116148d0d1587601a87b48bb2db to your computer and use it in GitHub Desktop.
Save yatsenkolesh/a63d4116148d0d1587601a87b48bb2db to your computer and use it in GitHub Desktop.
<?php
use Abrouter\Client\Client;
class ExampleController
{
public function __invoke(Client $client)
{
$userId = auth()->user()->id;
$buttonColor = $client->experiments()->run($userId, 'button_color_test');
return view('button', [
'color' => $buttonColor->getBranchId(),
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment