src/HasManyDeep.php
public function withTrashed(...$columns)
    {
        if (empty($columns)) {
            $this->query->withTrashed();

            return $this;
        }

        if (is_array($columns[0])) {
            $columns = $columns[0];
        }

        $this->query->getQuery()->wheres = collect($this->query->getQuery()->wheres)
            ->reject(function ($where) use ($columns) {
                return $where['type'] === 'Null' && in_array($where['column'], $columns);
            })->values()->all();

        return $this;
    }
public function withTrashed(...$columns)
    {
        if (empty($columns)) {
            $this->query->withTrashed();

            return $this;
        }

        if (is_array($columns[0])) {
            $columns = $columns[0];
        }

        $this->query->getQuery()->wheres = collect($this->query->getQuery()->wheres)
            ->reject(function ($where) use ($columns) {
                return $where['type'] === 'Null' && in_array($where['column'], $columns);
            })->values()->all();

        return $this;
    }
public function withTrashed ( ... $ columns ) { if ( empty ( $ columns ) ) { $ this -> query -> withTrashed ( ) ; return $ this ; } if ( is_array ( $ columns [ 0 ] ) ) { $ columns = $ columns [ 0 ] ; } $ this -> query -> getQuery ( ) -> wheres = collect ( $ this -> query -> getQuery ( ) -> wheres ) -> reject ( function ( $ where ) use ( $ columns ) { return $ where [ 'type' ] === 'Null' && in_array ( $ where [ 'column' ] , $ columns ) ; } ) -> values ( ) -> all ( ) ; return $ this ; }
Restore soft-deleted models.

@param  string  ...$columns
@return $this
Restore soft - deleted models .