This package provides a Laravel integration for the SharpAPI Content Proofreading service. It allows you to check and correct grammar, spelling, and style issues in text content, which is perfect for ensuring high-quality content in your applications.
You can install the package via composer:
composer require sharpapi/laravel-content-proofreadPublish the config file with:
php artisan vendor:publish --tag="sharpapi-content-proofread"This is the contents of the published config file:
return [
'api_key' => env('SHARP_API_KEY'),
'base_url' => env('SHARP_API_BASE_URL', 'https://sharpapi.com/api/v1'),
'api_job_status_polling_wait' => env('SHARP_API_JOB_STATUS_POLLING_WAIT', 180),
'api_job_status_polling_interval' => env('SHARP_API_JOB_STATUS_POLLING_INTERVAL', 10),
'api_job_status_use_polling_interval' => env('SHARP_API_JOB_STATUS_USE_POLLING_INTERVAL', false),
];Make sure to set your SharpAPI key in your .env file:
SHARP_API_KEY=your-api-key
use SharpAPI\ContentProofread\ContentProofreadService;
$service = new ContentProofreadService();
// Proofread text
$proofreadText = $service->proofread(
'This text has some gramatical errors and typos that need to be corected.'
);
// proofread() returns a status URL; fetchResults() polls until the job is done
$job = $service->fetchResults($proofreadText);
$corrected = $job->result->proofread;text(string): The text content to proofread and check for grammar issues
{
"data": {
"type": "api_job_result",
"id": "2432f9ee-528a-4709-9916-2ab031df27ab",
"attributes": {
"status": "success",
"type": "content_proofread",
"result": {
"proofread": "Red Bull's Max Verstappen says this weekend's Las Vegas Grand Prix is \"99% show and 1% sporting event\". ...",
"output_format": "text",
"output_html_css": null
}
}
}
}- Corrects spelling errors
- Fixes grammatical mistakes
- Improves sentence structure
- Enhances readability
- Maintains the original meaning of the text
This package ships a Laravel Boost skill, sharpapi-content-proofread. It teaches AI coding agents the async submit-then-fetchResults() flow, the queued-job recipe, the result shape and the testing approach. Boost 2 or newer is required. In your app:
composer require laravel/boost --dev
php artisan boost:install # first time
php artisan boost:update --discover # already using BoostSelect sharpapi/laravel-content-proofread when Boost lists the packages it found. The skill loads on demand; no always-on guideline is added.
The MIT License (MIT). Please see License File for more information.