laravel-nestedset icon indicating copy to clipboard operation
laravel-nestedset copied to clipboard

Can't select specific columns in get() method

Open anton-reviakin opened this issue 5 years ago • 1 comments

Can't select specific columns in ->get(['id', 'title']) method. Always I get all fileds (* in select query)

anton-reviakin avatar Dec 08 '20 14:12 anton-reviakin

Hi Anton, I'd also tried to figure this out and opened a thread last year. https://github.com/lazychaser/laravel-nestedset/issues/318 As you'll see @mackhankins found a solution from comments in NestedSets code... * To successfully build tree "id", "_lft" and "parent_id" keys must present.

So I think you should find this works... ->get(['_lft', '_rgt', 'parent_id', 'id', 'title'])

as a thought I dont know what happens if parent_id isnt present in schema?

Regards

l.

londoh avatar Dec 15 '20 08:12 londoh