$fulltext = new LaravelGoogleCustomSearchEngine(); // initialize
$results = $fulltext->getResults('some phrase'); // get first 10 results for query 'some phrase'
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use JanDrda\LaravelGoogleCustomSearchEngine\LaravelGoogleCustomSearchEngine;
class GoogleSearchController extends Controller
{
public function index(){
$fulltext = new LaravelGoogleCustomSearchEngine(); // initialize
$results = $fulltext->getResults('some phrase'); // get first 10 results for query 'some phrase'
}
}
$fulltext = new LaravelGoogleCustomSearchEngine(); // initialize
$results = $fulltext->getResults('some phrase'); // get first 10 results for query 'some phrase'
$info = $fulltext->getSearchInformation(); // get search information
$parameters = array(
'start' => 10 // start from the 10th results,
'num' => 10 // number of results to get, 10 is maximum and also default value
)
$fulltext = new LaravelGoogleCustomSearchEngine(); // initialize
$results = $fulltext->getResults('some phrase', $parameters); // get second 10 results for query 'some phrase'
$fulltext = new LaravelGoogleCustomSearchEngine(); // initialize
$results = $fulltext->getResults('some phrase'); // get first 10 results for query 'some phrase'
$rawResults = $fulltext->getRawResults(); // get complete response from Google
$fulltext = new LaravelGoogleCustomSearchEngine(); // initialize
$results = $fulltext->getResults('some phrase'); // get first 10 results for query 'some phrase'
$noOfResults = $fulltext->getTotalNumberOfResults(); // get total number of results (it can be less than 10)
$fulltext = new LaravelGoogleCustomSearchEngine(); // initialize
$fulltext->setEngineId('someEngineId'); // sets the engine ID
$fulltext->setApiKey('someApiId'); // sets the API key
$results = $fulltext->getResults('some phrase'); // get first 10 results for query 'some phrase'