PHP code example of aon2003 / laravel-trustpilot

1. Go to this page and download the library: Download aon2003/laravel-trustpilot library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aon2003 / laravel-trustpilot example snippets


return [
    /*
     |--------------------------------------------------------------------------
     | Default Domain
     |--------------------------------------------------------------------------
     |
     | This is the domain for which the reviews will be scraped by default.
     | Supports subdomains.
     */
    'domain' => 'www.example.com',

    /*
     |--------------------------------------------------------------------------
     | Default Language
     |--------------------------------------------------------------------------
     |
     | This is the language in which the reviews will be scraped by default.
     |
     | Supported values: "all", ISO 639-1 language codes (ex.: "en", "ru")
     |
     */
    'language' => 'all',
];

$score = LaravelTrustpilot::getScore($domain); // float
$reviews = LaravelTrustpilot::getReviews($domain, $language); // array<stdClass>

Description:
  Gets the TrustScore of a given domain and outputs it to the console.

Usage:
  trustpilot:score [<domain>]

Arguments:
  domain                The domain for which to get the TrustScore.

Description:
  Gets the reviews of a given domain and outputs them to the console.

Usage:
  trustpilot:reviews [<domain> [<language>]]

Arguments:
  domain                The domain for which to get the TrustPilot reviews.
  language              The language in which to get the TrustPilot reviews.
bash
php artisan vendor:publish --tag="trustpilot-config"