PHP code example of disintegrations / shad-serializer-laravel
1. Go to this page and download the library: Download disintegrations/shad-serializer-laravel 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/ */
disintegrations / shad-serializer-laravel example snippets
use Disintegrations\ShadSerializer\ShadClient;
$shad = app(ShadClient::class);
$sent = $shad->sendCode('98912...');
$session = $shad->signIn('98912...', $sent['phone_code_hash'], '123456');
$shad->registerDevice();
$shad->saveState(storage_path('app/shad-state.json'));
$chats = $shad->getChats();
$shad->sendMessage('u0...', 'Hello from Laravel');
$shad->sendFile('u0...', storage_path('app/document.pdf'));
$shad = ShadClient::loadState(storage_path('app/shad-state.json'));
$result = $shad->callData('getMySessions');
use Disintegrations\ShadSerializer\Facades\Shad;
$chats = Shad::getChats();
use Disintegrations\ShadSerializer\Protocol\ShadProtocol;
$encrypted = ShadProtocol::encryptData(['method' => 'example'], $auth);
$decoded = ShadProtocol::decryptData($encrypted, $auth);
bash
php artisan vendor:publish --tag=shad-config