atayahmet / laravel-nestable

Laravel 5 nested category/menu generator
MIT License
214 stars 52 forks source link

Embed Placeholder Item (Empty Element) and Bug on selected Item #9

Closed gieart87 closed 7 years ago

gieart87 commented 7 years ago

Hello @atayahmet This is very awesome plugin so far.. But I found some issues :

  1. How to embed placeholder / empty item in dropdown? Right now it will generate dropdown item from table's record. I got problem when I want to add element <option value="">Please Choose</option>

  2. I try to assign selected item. I code like this: ShopCategory::selected(1)->renderAsDropdown() but always generate a multiple type option that I don't want. How to solve this?

  3. It will also break the laravel query builder :( . For example I have code like this: ShopCategory::where('parent_id',0)->orderBy('name','ASC')->get() , the condition 'parent_id' = 0 will be ignored.

Thanks

atayahmet commented 7 years ago

Hi @gieart87

I fixed problems and added placeholder option. Please update package.

Thanks for feedback.