laravel-nestedset
laravel-nestedset copied to clipboard
Can't select specific columns in get() method
Can't select specific columns in ->get(['id', 'title']) method. Always I get all fileds (* in select query)
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.