1. Go to this page and download the library: Download yannelli/laravel-plaud 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/ */
yannelli / laravel-plaud example snippets
use Yannelli\LaravelPlaud\Facades\Plaud;
// Authenticate with username and password
$authResponse = Plaud::authenticate('your-username', 'your-password');
// Access token is automatically set in the client
$accessToken = $authResponse->accessToken;
use Yannelli\LaravelPlaud\PlaudService;
class RecordingController extends Controller
{
public function __construct(
protected PlaudService $plaud
) {}
public function index()
{
$recordings = $this->plaud->getAllRecordings();
return view('recordings.index', compact('recordings'));
}
}
use Yannelli\LaravelPlaud\Facades\Plaud;
$user = Plaud::getMyUser();
echo $user->dataUser->email;
echo $user->dataUser->nickname;
$status = Plaud::getStatus();
// Check processing status
if (!empty($status->dataProcessingTranssummAi->filesTrans)) {
echo "Files are being transcribed...";
}
use Yannelli\LaravelPlaud\Facades\Plaud;
use Illuminate\Support\Facades\Storage;
$recordingId = 'your-recording-id';
$base64Audio = Plaud::downloadAudioFile($recordingId);
// Decode and save to storage
$audioData = base64_decode($base64Audio);
Storage::put('recordings/audio.mp3', $audioData);
use Yannelli\LaravelPlaud\Constants\FileTypes;
$recordingId = 'your-recording-id';
// Download as PDF
$base64Transcript = Plaud::downloadTranscriptFile($recordingId, FileTypes::PDF);
// Or download as TXT, DOCX, SRT, or Markdown
$base64Transcript = Plaud::downloadTranscriptFile($recordingId, FileTypes::TXT);
// Save to storage
$transcriptData = base64_decode($base64Transcript);
Storage::put('recordings/transcript.pdf', $transcriptData);
use Yannelli\LaravelPlaud\Constants\FileTypes;
FileTypes::MP3 // Audio format
FileTypes::WAV // Audio format
FileTypes::TXT // Plain text
FileTypes::PDF // PDF document
FileTypes::DOCX // Microsoft Word
FileTypes::SRT // Subtitle format
FileTypes::MARKDOWN // Markdown format
use Yannelli\LaravelPlaud\Facades\Plaud;
use Yannelli\LaravelPlaud\Exceptions\PlaudException;
try {
$recordings = Plaud::getAllRecordings();
} catch (PlaudException $e) {
// Handle API errors
logger()->error('Plaud API Error: ' . $e->getMessage());
// Get HTTP status code if available
$statusCode = $e->getCode();
}
use Yannelli\LaravelPlaud\PlaudClient;
$client = new PlaudClient();
$client->authenticate('username', 'password');
// Make custom API requests
$response = $client->get('/custom/endpoint');
$response = $client->post('/custom/endpoint', ['data' => 'value']);
use Yannelli\LaravelPlaud\Facades\Plaud;
$client = Plaud::getClient();
$accessToken = Plaud::getAccessToken();