PHP code example of acadea / fullsite-search

1. Go to this page and download the library: Download acadea/fullsite-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/ */

    

acadea / fullsite-search example snippets


// Expect a collection of models in the search result
$results = \Acadea\FullSite\FullSiteSearch::search('in');

// Controller
return \Acadea\FullSite\Resources\SiteSearchResource::collection($results);

return [
    // path to your models directory, relative to /app
    'model_path' => 'Models',

    'api' => [
        // enable api endpoint
        'disabled' => false,
        // the api endpoint uri
        'url' => '/api/site-search',
    ],

    // you can put any models that you want to exclude from the search here
    'exclude' => [
        // example:
        // \App\Models\Comment::class
    ],

    // the number of neighbouring characters that you want to 
bash
php artisan vendor:publish --provider="Acadea\FullSite\FullSiteServiceProvider" --tag="config"