PHP code example of waaseyaa / search

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

    

waaseyaa / search example snippets


final class AppSearchProvider extends ServiceProvider implements ProvidesEntitySearchProjectorsInterface
{
    public function register(): void
    {
        $this->singleton(ProvidesEntitySearchProjectorsInterface::class, fn() => $this);
    }

    public function entitySearchProjectors(): array
    {
        // Consulted ahead of NodeSearchProjector: supports('node') here
        // replaces the default projection (site URL scheme, extra fields),
        // and project() may return null to keep content out of the index.
        return [new AppNodeSearchProjector()];
    }
}