Skip to content

Instantly share code, notes, and snippets.

View yatsenkolesh's full-sized avatar
💭
Hi there. Don't forget to star all my repos

Alex Yatsenko yatsenkolesh

💭
Hi there. Don't forget to star all my repos
View GitHub Profile
<?php
use Abrouter\Client\Client;
use Abrouter\Client\Builders\StatEventBuilder;
class ExampleController
{
public function __invoke(Client $client, StatEventBuilder $statEventBuilder)
{
$userId = auth()->user()->id;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Laravel Test page</title>
</head>
<body>
<div>Hello. It's a ABRouter feature flags example. </div>
<br/>
<?php
declare(strict_types = 1);
namespace App\Http\Controllers;
use Abrouter\Client\Client;
class ExampleFeatureFlagsController
{
public function __invoke(Client $client)
<?php
use Abrouter\Client\Client;
use Abrouter\Client\DTO\EventDTO;
/**
* @var Client $client
*/
$client = container()->make(Abrouter\Client\Client::class);
$userSignature = uniqid();
<?php
declare(strict_types = 1);
return [
'token' => '0ea94e3527644b8e6259b790d866223490f3c91634bbfd0eb978b4a57a4d835d57ab5195f892b15d',
'host' => 'https://abrouter.com',
];
<?php
declare(strict_types = 1);
return [
'token' => '0ea94e3527644b8e6259b790d866223490f3c91634bbfd0eb978b4a57a4d835d57ab5195f892b15d',
'host' => 'https://abrouter.com',
];
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Laravel Test page</title>
</head>
<body>
<div>Hello. It's a ABRouter example. Refresh the page to change color button. </div>
<div>Distribution: 33% - red, 33% - green, 33% - blue</div>
<?php
declare(strict_types = 1);
namespace App\Http\Controllers;
use Abrouter\Client\Client;
class ExampleFeatureFlagsController
{
public function __invoke(Client $client)
USE
if (!emptyMulti($redirectIfMobileModule, $redirectIfMobileAction)) {
...
}
INSTEAD OF
if (!empty($redirectIfMobileModule) && $redirectIfMobileAction) {
...
}
------WebKitFormBoundaryu8dFdlDqoUBfhLbg
Content-Disposition: form-data; name="upload_id"
1494800925227
------WebKitFormBoundaryu8dFdlDqoUBfhLbg
Content-Disposition: form-data; name="photo"; filename="photo.jpg"
Content-Type: image/jpeg
------WebKitFormBoundaryu8dFdlDqoUBfhLbg