Check the full documentation on the Custom AI Workflows page.
| Resource | Link |
|---|---|
| Product Details | SharpAPI.com |
| PHP SDK (non-Laravel) | sharpapi/php-custom-workflow |
| SDK Libraries | GitHub - SharpAPI SDKs |
- PHP >= 8.1
- Laravel 10, 11, or 12
- A SharpAPI account with an API key
composer require sharpapi/laravel-custom-workflowStep 2. Visit SharpAPI to get your API key.
SHARPAPI_API_KEY=your-api-keyphp artisan vendor:publish --tag=sharpapi-custom-workflowThis package provides a Laravel-native wrapper around sharpapi/php-custom-workflow. It adds:
- Service Provider with deferred loading (singleton only created when first used)
- Facade for quick static access
- Dependency Injection support
- Publishable configuration with auto-discovery
use SharpAPI\LaravelCustomWorkflow\Facades\CustomWorkflow;
// Execute a workflow
$statusUrl = CustomWorkflow::executeWorkflow('my-sentiment-analyzer', [
'text' => 'Great product!',
'score' => 4.5,
]);
// Fetch results when ready
$result = CustomWorkflow::fetchResults($statusUrl);
// List your workflows
$workflows = CustomWorkflow::listWorkflows();
// Describe a workflow's schema
$definition = CustomWorkflow::describeWorkflow('my-analyzer');
// Validate + execute in one call
$statusUrl = CustomWorkflow::validateAndExecute('my-analyzer', ['text' => 'hello']);use SharpAPI\CustomWorkflow\CustomWorkflowClient;
class AnalyzeController extends Controller
{
public function analyze(CustomWorkflowClient $client)
{
$statusUrl = $client->executeWorkflow('my-sentiment-analyzer', [
'text' => 'Great product!',
]);
return $client->fetchResults($statusUrl);
}
}After publishing, the config file is at config/sharpapi-custom-workflow.php:
return [
'api_key' => env('SHARPAPI_API_KEY'),
'base_url' => env('SHARPAPI_BASE_URL', 'https://sharpapi.com/api/v1'),
];Please see CHANGELOG for more information on what has changed recently.
- A2Z WEB LTD
- Dawid Makowski
- Boost your PHP AI capabilities!
The MIT License (MIT). Please see License File for more information.
🚀 For the latest news, tutorials, and case studies, don't forget to follow us on:
