7 months ago

Treeview with ---

Posted 7 months ago by Vishaal


I'm building treeview inside mine laravel application but i have an problem with the view.

Current i'm getting everything under the same select box. Sample;

demo1 demo2 demo3

but i want this inside select options like

demo1 ---demo2 ------demo3

mine controller code

$categories = Pool::where('parent_id', '=', 0)->get();
$allCategories = Pool::pluck('title','id')->all();
return view('admin.accept', compact(['categories','allCategories']));


<div class="form-group {{ $errors->has('parent_id') ? 'has-error' : '' }}">
                                        {!! Form::label('Pool:') !!}
                                        {!! Form::select('parent_id',$allCategories, old('parent_id'), ['class'=>'form-control', 'placeholder'=>'Kies uw Pool']) !!}
                                        <span class="text-danger">{{ $errors->first('parent_id') }}</span>

                                    <div class="form-group {{ $errors->has('title') ? 'has-error' : '' }}">
                                        {!! Form::label('Naam:') !!}
                                        {!! Form::text('title', old('title'), ['class'=>'form-control', 'placeholder'=>'Enter Title']) !!}
                                        <span class="text-danger">{{ $errors->first('title') }}</span>

How i can do this?

Please sign in or create an account to participate in this conversation.