A Laravel package that provides a Copyscape interface for their premium API.
For Laravel 10.x:
composer require juanparati/copyscape "~10.0"
For Laravel 9.x:
composer require juanparati/copyscape "~4.0"
For Laravel 8.x:
composer require juanparati/copyscape "~3.0"
For Laravel 6.x/7.x:
composer require juanparati/copyscape "~2.0"
For Laravel 5.5 to 5.8:
composer require juanparati/copyscape "~1.0"
For Laravel 5.5 it is required to register the service provider into the "config/app.php":
Juanparati\Copyscape\CopyscapeServiceProvider::class,
For Laravel 5.6+ the service provider is automatically registered.
artisan vendor:publish --provider="Juanparati\Copyscape\CopyscapeServiceProvider"
Optionally add the following Alias in your config/app.php (Aliases section):
'Copyscape' => Juanparati\Copyscape\Facades\CopyscapeClient::class,
// Search without full comparison.
$results = Copyscape::searchURL('https://example.net')->request();
// With optional options
$search = Copyscape::searchURL('https://en.wikipedia.org/wiki/United_States_Declaration_of_Independence');
$search->setFullComparison(5); // Set full comparison (0 for disable, 1-10 for full comparison)
$search->setIgnoreSites(['britannica.com']);
$search->setSpendLimit(0.1);
$search->setTestMode(true);
$results = $search->request();
// Search without full comparison
$results = Copyscape::searchText('We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, as we hold the rest of mankind, Enemies in War, in Peace Friends.')->request();
// With optional options
$search = Copyscape::searchText('We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, as we hold the rest of mankind, Enemies in War, in Peace Friends.');
$search->setFullComparison(5); // Set full comparison (0 for disable, 1-10 for full comparison)
$search->setIgnoreSites(['britannica.com']);
$search->setSpendLimit(0.1);
$search->setTestMode(true);
$results = $search->request();
It's possible to change the possible search type using the "setSearchType" method:
Copyscape::searchText('Hello Universe')
->setSearchType(\Juanparati\Copyscape\Services\SearchService::SEARCH_TYPE_PRIVATE)
->request();
The following search types are available:
\Juanparati\Copyscape\Services\SearchService::SEARCH_TYPE_PUBLIC // Search against public index
\Juanparati\Copyscape\Services\SearchService::SEARCH_TYPE_PRIVATE // Search against private index
\Juanparati\Copyscape\Services\SearchService::SEARCH_TYPE_BOTH // Search against public and private indexes
In order to use the private index, remember to create a private index from the Copyscape interface
$results = Copyscape::indexURL('https://example.net', 'my_index_id');
$results = Copyscape::indexText('Hello World', 'my_index_id');
$results = Copyscape::getBalance();