We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you show how to implement TreeSelect and pass options?
The text was updated successfully, but these errors were encountered:
I use kalnoy/nestedset to create nested set.
kalnoy/nestedset
Inside Resource
Resource
public function fields(Request $request) { $nodes = Category::get()->toTree(); $categories = $this->mapCategories($nodes); return [ TreeSelect::make('Parent id')->options($categories)->onlyOnForms(), BelongsTo::make('Category', 'parent')->searchable()->hideWhenCreating()->hideWhenUpdating(), HasMany::make('Category', 'children') } private function mapCategories($nodes) { $categories = []; foreach($nodes as $key => $node) { $categories[] = [ 'id' => $node->id, 'label' => $node->title, 'children' => mapCategories($node->children) ]; } return collect($categories); }
I created PR to fix missing laravel nova mixins #2
Sorry, something went wrong.
No branches or pull requests
Can you show how to implement TreeSelect and pass options?
The text was updated successfully, but these errors were encountered: