<div class="col-md-6">
    <div class="form-group pt-3">
        <label>
            جستجو
        </label>
        <input  type="text" id="pSearchInput" class="form-control mt-1" placeholder="جستجو">
    </div>
</div>
<div class="col-md-12">
    <div class="row">
        @foreach(\Modules\Core\Entities\Permissions::groupBy('title')->orderBy('title')->where('title','!=','need_to_declare')->get() as $permission)
            <div data-search="{{$permission->title}}" class="col-md-2 perm">
                <div class="mt-4">
                    <div class="form-group pt-3">
                        <label style="vertical-align: middle">{{$permission->title}}</label>
                        <label class="switch ml-5 pull-left" style="vertical-align: middle">
                            @if(isset($permissions))
                            <input name="permissions[]" value="{{$permission->id}}" type="checkbox" @if(array_search($permission->id,$permissions->toArray())!== false) checked="" @endif>
                            @else
                                <input name="permissions[]" value="{{$permission->id}}" type="checkbox">
                            @endif
                            <span class="slider round"></span>
                        </label>
                    </div>
                </div>
            </div>
        @endforeach
    </div>
</div>
