PHP code example of divineomega / laravel-omega-search

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

    

divineomega / laravel-omega-search example snippets


    public function getOmegaSearchTablesToJoin()
    {
        return [
            OmegaSearchJoin::joinTableByForeignKey($this->getTable(), 'divisions'),
        ];
    }

    public function getOmegaSearchTablesToJoin()
    {
        return [
            OmegaSearchJoin::joinTableByForeignKey($this->getTable(), 'divisions', 'id', 'division_id),
        ];
    }

    public function getOmegaSearchTablesToJoin()
    {
        return [
            OmegaSearchJoin::joinTableByForeignKey($this->getTable(), 'divisions'),
            OmegaSearchJoin::joinTableByForeignKey('divisions', 'companies', 'id', 'company_id')
        ];
    }

    public function getOmegaSearchTablesToJoin()
    {
        $join = new OmegaSearchJoin('contacts', 'divisions', 'INNER JOIN');
        $join->addCondition('gross_income', '>', 'annual_income');
        
        return [
            $join,
        ];
    }