An unofficial Laravel package for the Plaud API. This package provides a clean, Laravel-idiomatic interface for managing recordings, transcriptions, and summaries from the Plaud platform.
- âś… Full authentication support
- âś… Retrieve and manage recordings
- âś… Download audio files, transcripts, and summaries
- âś… Create shareable links
- âś… Trash, restore, and permanently delete recordings
- âś… Laravel HTTP client integration
- âś… Facade support for easy access
- âś… Type-safe models with PHP 8.3+ typed properties
- âś… Comprehensive error handling
- PHP 8.3 or higher
- Laravel 12.x
- Guzzle HTTP client 7.x
Install the package via Composer:
composer require yannelli/laravel-plaudYou can publish the configuration file if you want to customize it:
php artisan vendor:publish --tag=plaud-configThis will create a config/plaud.php file in your Laravel application.
Add your Plaud access token to your .env file:
PLAUD_ACCESS_TOKEN=your-access-token-hereFirst, authenticate with the Plaud API to obtain an access token:
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;You can also use dependency injection instead of the facade:
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...";
}$recordings = Plaud::getAllRecordings();
foreach ($recordings->dataFileList as $recording) {
echo $recording->filename;
echo $recording->duration;
echo $recording->startTime;
}$recordings = Plaud::getRecordingsWithFilter(
skip: 0,
limit: 50,
isTrash: 0, // 0 = not in trash, 1 = in trash, 2 = all
sortBy: 'start_time',
isDesc: true
);$recordingIds = ['recording-id-1', 'recording-id-2'];
$recordings = Plaud::getSpecificRecordings($recordingIds);$tags = Plaud::getFileTags();
foreach ($tags->dataFiletagList as $tag) {
echo $tag->name;
echo $tag->color;
}use Yannelli\LaravelPlaud\Models\Requests\RequestShareableLinkPermissions;
$permissions = new RequestShareableLinkPermissions(
isAudio: 1, // Allow audio sharing
isTrans: 1, // Allow transcript sharing
isAiContent: 1, // Allow AI content sharing
isMindmap: 0 // Disable mindmap sharing
);
$shareableLink = Plaud::createShareableLink('recording-id', $permissions);
echo $shareableLink->url; // The shareable URLuse 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;
$recordingId = 'your-recording-id';
$base64Summary = Plaud::downloadSummaryFile($recordingId, FileTypes::DOCX);
$summaryData = base64_decode($base64Summary);
Storage::put('recordings/summary.docx', $summaryData);$recordingIds = ['recording-id-1', 'recording-id-2'];
$success = Plaud::trashRecordings($recordingIds);
if ($success) {
echo "Recordings moved to trash successfully";
}$recordingIds = ['recording-id-1', 'recording-id-2'];
$success = Plaud::untrashRecordings($recordingIds);$recordingIds = ['recording-id-1', 'recording-id-2'];
$success = Plaud::permanentlyDeleteRecordings($recordingIds);
if ($success) {
echo "Recordings permanently deleted";
}The package provides a FileTypes constant class with the following supported formats:
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 formatThe package throws PlaudException for API errors:
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();
}If you need more control, you can use the PlaudClient directly:
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();| Method | Description |
|---|---|
authenticate($username, $password) |
Authenticate with username and password |
getMyUser() |
Get current user information |
getStatus() |
Get API and system status |
getAllRecordings() |
Get all recordings without filters |
getRecordingsWithFilter(...) |
Get recordings with custom filters |
getSpecificRecordings($ids) |
Get specific recordings by IDs |
getFileTags() |
Get all file tags (folders) |
createShareableLink($id, $permissions) |
Create a shareable link |
downloadAudioFile($id) |
Download audio file as base64 |
downloadTranscriptFile($id, $type) |
Download transcript as base64 |
downloadSummaryFile($id, $type) |
Download summary as base64 |
trashRecordings($ids) |
Move recordings to trash |
untrashRecordings($ids) |
Restore recordings from trash |
permanentlyDeleteRecordings($ids) |
Permanently delete recordings |
composer testPlease see CHANGELOG for more information on what has changed recently.
Contributions are welcome! Please feel free to submit a Pull Request.
If you discover any security-related issues, please email the package maintainer instead of using the issue tracker.
- Original .NET library: JamesStuder/Plaud_API
- Laravel package maintainer: Ryan Yannelli
The MIT License (MIT). Please see License File for more information.
This is an unofficial package and is not affiliated with, maintained, or endorsed by Plaud. Use at your own risk.