src/RetrievesIntermediateTables.php
public function withIntermediate($class, array $columns = ['*'], $accessor = null)
    {
        /** @var \Illuminate\Database\Eloquent\Model $instance */
        $instance = new $class;

        $accessor = $accessor ?: Str::snake(class_basename($class));

        return $this->withPivot($instance->getTable(), $columns, $class, $accessor);
    }
public function withIntermediate($class, array $columns = ['*'], $accessor = null)
    {
        /** @var \Illuminate\Database\Eloquent\Model $instance */
        $instance = new $class;

        $accessor = $accessor ?: Str::snake(class_basename($class));

        return $this->withPivot($instance->getTable(), $columns, $class, $accessor);
    }
public function withIntermediate ( $ class , array $ columns = [ '*' ] , $ accessor = null ) { /** @var \Illuminate\Database\Eloquent\Model $instance */ $ instance = new $ class ; $ accessor = $ accessor ? : Str :: snake ( class_basename ( $ class ) ) ; return $ this -> withPivot ( $ instance -> getTable ( ) , $ columns , $ class , $ accessor ) ; }
Set the columns on an intermediate table to retrieve.

@param  string  $class
@param  array  $columns
@param  string|null  $accessor
@return $this
Set the columns on an intermediate table to retrieve .