Download the PHP package gregpriday/laravel-serper without Composer
On this page you can find all versions of the php package gregpriday/laravel-serper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gregpriday/laravel-serper
More information about gregpriday/laravel-serper
Files in gregpriday/laravel-serper
Package laravel-serper
Short Description This is my package laravel-serper
License MIT
Homepage https://github.com/gregpriday/laravel-serper
Informations about the package laravel-serper
Laravel Serper Package README
Introduction
The Laravel Serper package is a simple, efficient wrapper around the Serper.dev API, designed to integrate seamlessly with Laravel applications. It provides a fluent, expressive interface to perform searches and retrieve news results from Google via Serper.dev, making it easier for developers to include search functionalities in their Laravel applications.
Features
- Easy-to-use facade for performing searches and retrieving news results.
- Support for single and multiple queries with customizable parameters.
- Integration with Laravel's service container for easy configuration and extension.
- Utilizes GuzzleHttp for efficient HTTP requests.
- Includes a suite of unit tests for reliability and maintainability.
Installation
To install the Laravel Serper package, run the following command in your terminal:
After installation, publish the package's configuration file by running:
Configuration
Before using the Serper package, you must obtain an API key from Serper.dev and add it to your .env
file:
Then, configure your API key in the config/serper.php
configuration file:
Usage
The Laravel Serper package provides a simple API to perform search and news queries. Here's how you can use it:
Performing a Search
To perform a search, use the Serper::search
method:
Retrieving News Results
To retrieve news results, specify the type as 'news' in the search
method:
Performing Multiple Searches
To perform multiple searches at once, use the Serper::searchMulti
method:
Testing
This package comes with a suite of PHPUnit tests. To run the tests, use the following command:
Contribution
Contributions are welcome! Please feel free to submit pull requests or open issues on the GitHub repository.
License
The Laravel Serper package is open-sourced software licensed under the MIT license.
All versions of laravel-serper with dependencies
guzzlehttp/guzzle Version ^7.8
illuminate/contracts Version ^10.0
spatie/laravel-package-tools Version ^1.14.0