Download the PHP package samandar/laravel-elevenlabs without Composer
On this page you can find all versions of the php package samandar/laravel-elevenlabs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download samandar/laravel-elevenlabs
More information about samandar/laravel-elevenlabs
Files in samandar/laravel-elevenlabs
Package laravel-elevenlabs
Short Description Laravel package for ElevenLabs Text-to-Speech API integration with full API support
License MIT
Informations about the package laravel-elevenlabs
ElevenLabs Laravel Package
A comprehensive Laravel package for integrating with ElevenLabs Text-to-Speech API
Featuring modular architecture, backward compatibility, and professional-grade functionality.
๐ Package Statistics
- ๐๏ธ Architecture: Modular service-based design
- ๐งช Tests: 46 tests with 80 assertions (100% passing)
- ๐ฆ Services: 6 specialized service classes
- ๐ง Methods: 50+ API methods available
- ๐ Features: TTS, STT, Voice Cloning, Dubbing, AI Chat, and more
- ๐ Documentation: Comprehensive guides and examples
- ๐ Compatibility: Full backward compatibility maintained
Features
๐ฏ Core Features
- Text-to-Speech conversion with multiple models
- Speech-to-Text transcription capabilities
- Speech-to-Speech voice conversion
- Streaming TTS for real-time audio generation
- ๐ Support for multiple languages and voices
- โ๏ธ Configurable voice settings with fine-tuning
๐ญ Voice Management
- Voice cloning and custom voice creation
- Voice library access and similarity search
- Voice settings editing and deletion
- Shared voices from community library
- Voice similarity detection
๐ Advanced Features
- Dubbing for video/audio translation
- History Management for generation tracking
- Pronunciation Dictionaries for custom pronunciations
- Forced Alignment for precise audio-text synchronization
๐ฌ Studio & Projects
- Studio Projects creation and management
- Podcast Project generation
- Project conversion and media processing
- File upload and project organization
๐ค Conversational AI
- Knowledge Base creation from URLs
- Conversational AI Settings management
- Workspace Secrets handling
- Resource sharing and collaboration tools
๐ Analytics & Management
- Usage Statistics and character tracking
- Generation history and analytics
- User subscription information
- Comprehensive error handling and logging
๐ง Laravel Integration
- Simple and intuitive API
- Laravel service container integration
- Facade support for easy usage
- Automatic file saving capabilities
- Comprehensive test coverage
Installation
You can install the package via composer:
Configuration
-
Publish the configuration file:
-
Add your ElevenLabs API key to your
.envfile: - Optionally configure other settings:
Usage
The package provides two approaches for accessing ElevenLabs functionality:
- New Modular Approach (Recommended) - Organized by feature groups
- Legacy Approach - Backward compatible with previous versions
๐ New Modular Approach
Audio Service (TTS, STT, STS, etc.)
Voice Service (Voice Management)
AI Service (Conversational AI & Knowledge Base)
Studio Service (Projects & Dubbing)
Analytics Service (Usage & History)
Workspace Service (Collaboration)
๐ Legacy Approach (Backward Compatible)
All existing code continues to work unchanged:
Using Dependency Injection
Controller Example
Available Methods
Text-to-Speech Methods
textToSpeech(string $text, string $voiceId, array $voiceSettings): arraytextToSpeechAndSave(string $text, string $filePath, string $voiceId, array $voiceSettings): arraystreamTextToSpeech(string $text, string $voiceId, string $modelId, array $voiceSettings): Generator
Speech-to-Text Methods
speechToText(UploadedFile|string $audioFile, string $modelId): array
Voice Management Methods
getVoices(): arraygetVoice(string $voiceId): arrayaddVoice(string $name, array $audioFiles, string $description, array $labels): arrayeditVoiceSettings(string $voiceId, array $voiceSettings): arraydeleteVoice(string $voiceId): arraygetSimilarLibraryVoices(UploadedFile|string $audioFile): array
History Methods
getHistory(int $pageSize, string $startAfterHistoryItemId): arraygetHistoryItem(string $historyItemId): arraydeleteHistoryItem(string $historyItemId): arraydownloadHistory(array $historyItemIds): array
Dubbing Methods
createDubbing(UploadedFile|string $sourceFile, string $targetLanguage, string $sourceLanguage, int $numSpeakers, bool $watermark): arraygetDubbing(string $dubbingId): arraygetDubbedAudio(string $dubbingId, string $languageCode): array
Speech-to-Speech Methods
speechToSpeech(string $voiceId, UploadedFile|string $audioFile, string $modelId, array $voiceSettings): array
Pronunciation Dictionary Methods
getPronunciationDictionaries(): arrayaddPronunciationDictionary(string $name, array $rules, string $description): array
Conversational AI Methods
getConversationalAISettings(): arrayupdateConversationalAISettings(array $settings): arraygetWorkspaceSecrets(): array
Knowledge Base Methods
createKnowledgeBaseFromURL(string $url): arraygetKnowledgeBases(?string $cursor, ?int $pageSize): arraydeleteKnowledgeBase(string $documentationId): array
Studio Projects Methods
getStudioProjects(): arraycreateStudioProject(UploadedFile|string $sourceFile, ?string $name): arraygetStudioProject(string $projectId): arraydeleteStudioProject(string $projectId): arrayconvertStudioProject(string $projectId): arraycreatePodcastProject(array $podcastData): array
Forced Alignment Methods
createForcedAlignment(UploadedFile|string $audioFile, string $text, string $language): array
Voice Library Methods
getSharedVoices(): array
Workspace Methods
shareWorkspaceResource(string $resourceId, array $shareData): array
Utility Methods
getUserInfo(): arraygetModels(): arraygetCharacterUsage(): arraysaveAudioToFile(string $audioContent, string $filePath): bool
Response Format
All methods return an array with the following structure:
Success Response:
Error Response:
Voice Settings
You can customize voice settings for more control over the generated speech:
Popular Voice IDs
Here are some popular voice IDs you can use:
21m00Tcm4TlvDq8ikWAM- Rachel (Female, American)AZnzlk1XvdvUeBnXmlld- Domi (Female, American)EXAVITQu4vr4xnSDxMaL- Bella (Female, American)ErXwobaYiN019PkySvjV- Antoni (Male, American)MF3mGyEYCl7XYWbV9V6O- Elli (Female, American)TxGEqnHWrfWFTfGW9XjX- Josh (Male, American)VR6AewLTigWG4xSOukaG- Arnold (Male, American)pNInz6obpgDQGcFmaJgB- Adam (Male, American)yoZ06aMxZJJ28mfd3POQ- Sam (Male, American)
Use ElevenLabs::getVoices() to get the complete list of available voices.
Configuration Options
The configuration file config/elevenlabs.php contains the following options:
Testing
Unit & Integration Tests
Run the test suite:
Or with PHPUnit directly:
Real API Tests
To run tests against the actual ElevenLabs API (requires API key):
Features:
- ๐ Automated retry logic - Runs until 100% success or max attempts
- ๐ Detailed reporting - Tracks success rates and failure analysis
- ๐ค GitHub Actions integration - CI/CD with matrix testing
- ๐ง Auto-fix suggestions - Analyzes failures and provides solutions
See REAL_API_TEST_GUIDE.md for complete documentation.
Testing
To run the tests:
Or run PHPUnit directly:
Error Handling
The package includes comprehensive error handling. All methods return success/error status:
Requirements
- PHP 8.1 or higher
- Laravel 9.x, 10.x, or 11.x
- GuzzleHTTP 7.x
- Valid ElevenLabs API key
License
This package is open-sourced software licensed under the MIT license.
Contributing
Please see CONTRIBUTING for details.
Support & Contributing
If you find this package helpful and would like to support its development, consider buying me a coffee! โ
๐ค How to Contribute
We welcome contributions! Here's how you can help:
- ๐ Report bugs - Open an issue on GitHub
- ๐ก Suggest features - We'd love to hear your ideas
- ๐ Improve documentation - Help make the docs even better
- ๐ง Submit pull requests - Code contributions are welcome
- โญ Star the repository - It helps others discover this package
๐ก๏ธ Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
๐ Support Channels
- GitHub Issues: Report bugs and feature requests
- Email: [email protected] for security issues
- Documentation: Comprehensive guides available in this README
Credits
- Abdullaev Samandar - Package author and maintainer
- ElevenLabs - For providing the amazing TTS API
- Laravel Community - For the inspiration and support
- All Contributors - Thank you for your valuable contributions!
Changelog
Please see CHANGELOG for more information on what has changed recently.
๐ Thank you for using ElevenLabs Laravel Package! ๐
If this package has been helpful, please consider:
โญ Starring the repository
๐ฆ Sharing with your network
โ Supporting the development
๐ค Contributing to the project
Made with โค๏ธ by Abdullaev Samandar
All versions of laravel-elevenlabs with dependencies
illuminate/support Version ^9.0|^10.0|^11.0
guzzlehttp/guzzle Version ^7.0