protected function addSearchJoin(Builder $query, $joining_table, $foreign_key, $related_key, $alias)
    {
        // We need to join to the intermediate table
        $local_table = $this->getModel()->getTable();

        // Set the way the table will be join, with an alias or without
        $table = $alias ? "{$joining_table} as {$alias}" : $joining_table;

        // Create an alias for the join
        $alias = $alias ?: $joining_table;

        // Create the join
        $query->join($table, "{$alias}.{$foreign_key}", "{$local_table}.{$related_key}");

        return $alias;
    }
protected function addSearchJoin(Builder $query, $joining_table, $foreign_key, $related_key, $alias)
    {
        // We need to join to the intermediate table
        $local_table = $this->getModel()->getTable();

        // Set the way the table will be join, with an alias or without
        $table = $alias ? "{$joining_table} as {$alias}" : $joining_table;

        // Create an alias for the join
        $alias = $alias ?: $joining_table;

        // Create the join
        $query->join($table, "{$alias}.{$foreign_key}", "{$local_table}.{$related_key}");

        return $alias;
    }
protected function addSearchJoin ( Builder $ query , $ joining_table , $ foreign_key , $ related_key , $ alias ) { // We need to join to the intermediate table $ local_table = $ this -> getModel ( ) -> getTable ( ) ; // Set the way the table will be join, with an alias or without $ table = $ alias ? "{$joining_table} as {$alias}" : $ joining_table ; // Create an alias for the join $ alias = $ alias ? : $ joining_table ; // Create the join $ query -> join ( $ table , "{$alias}.{$foreign_key}" , "{$local_table}.{$related_key}" ) ; return $ alias ; }
Add a search join to the query.

@param Builder $query
@param string  $joining_table
@param string  $foreign_key
@param string  $related_key
@param string  $alias

@return string
Add a search join to the query .