sharpapi / laravel-content-proofread
AI Content Proofreading and Grammar Checking for Laravel powered by SharpAPI.com
Package info
github.com/sharpapi/laravel-content-proofread
pkg:composer/sharpapi/laravel-content-proofread
Requires
- php: ^8.1
- ext-json: *
- laravel/framework: ^10.48.29|^11.0|^12.0|^13.0
- sharpapi/php-core: ^1.4.1
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- pestphp/pest: ^2.0|^3.0|^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
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.
Installation
You can install the package via composer:
composer require sharpapi/laravel-content-proofread
Configuration
Publish 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
Usage
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;
Parameters
text(string): The text content to proofread and check for grammar issues
Response Format
{
"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
}
}
}
}
Features
- Corrects spelling errors
- Fixes grammatical mistakes
- Improves sentence structure
- Enhances readability
- Maintains the original meaning of the text
AI agents (Laravel Boost)
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 Boost
Select sharpapi/laravel-content-proofread when Boost lists the packages it found. The skill loads on demand; no always-on guideline is added.
Credits
License
The MIT License (MIT). Please see License File for more information.