app/maguttiCms/Searchable/Searchable.php
/*
     * SIMPLE JOIN TABLE IN THE LIST
     */
SIMPLE JOIN TABLE IN THE LIST
SIMPLE JOIN TABLE IN THE LIST
public function joinable($objBuilder)
    {
        $joinTable = (isset($this->config['joinTable'])) ? trim($this->config['joinTable']) : "";
        $foreignJoinKey = (isset($this->config['foreignJoinKey'])) ? $this->config['foreignJoinKey'] : "id";
        $localJoinKey = (isset($this->config['localJoinKey'])) ? $this->config['localJoinKey'] : Str::singular($joinTable) . "_id";
        if ($joinTable != '') {
            $objBuilder->leftJoin($joinTable, $joinTable . '.' . $foreignJoinKey, '=',
                $this->model->getTable() . '.' . $localJoinKey);
            $this->mainTableSelect($objBuilder);
            if ($this->configHasProperty('joinFields')) {
                $objBuilder->addSelect($this->config['joinFields']);
            }
        }
    }
public function joinable ( $ objBuilder ) { $ joinTable = ( isset ( $ this -> config [ 'joinTable' ] ) ) ? trim ( $ this -> config [ 'joinTable' ] ) : " " ; $ foreignJoinKey = ( isset ( $ this -> config [ 'foreignJoinKey' ] ) ) ? $ this -> config [ 'foreignJoinKey' ] : " id " ; $ localJoinKey = ( isset ( $ this -> config [ 'localJoinKey' ] ) ) ? $ this -> config [ 'localJoinKey' ] : Str :: singular ( $ joinTable ) . " _id " ; if ( $ joinTable != '' ) { $ objBuilder -> leftJoin ( $ joinTable , $ joinTable . '.' . $ foreignJoinKey , '=' , $ this -> model -> getTable ( ) . '.' . $ localJoinKey ) ; $ this -> mainTableSelect ( $ objBuilder ) ; if ( $ this -> configHasProperty ( 'joinFields' ) ) { $ objBuilder -> addSelect ( $ this -> config [ 'joinFields' ] ) ; } } }
SIMPLE JOIN TABLE IN THE LIST
SIMPLE JOIN TABLE IN THE LIST