PHP code example of pascalvgemert / laravel-cloud-search
1. Go to this page and download the library: Download pascalvgemert/laravel-cloud-search 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/ */
pascalvgemert / laravel-cloud-search example snippets
use LaravelCloudSearch\Contracts\FieldType;
use LaravelCloudSearch\Document;
/**
* Define your CloudSearch index fields here, this will help to define default values in your document result:
*
* @property-read int $id
* @property-read string $title
* @property-read string $description
* @property-read string $country_code
* @property-read array $images
* @property-read int $stock
* @property-read bool $pre_order
*/
class Product extends Document
{
/** @var string */
protected $domain = 'http://your-domain-url-for-cloudsearch.eu-west-1.cloudsearch.amazonaws.com';
/** @var array */
protected $casts = [
'images' => FieldType::ARRAY,
'pre_order' => FieldType::BOOL,
'searchable' => FieldType::BOOL,
];
}