Exemplo n.º 1
0
 public function __construct(Guard $auth)
 {
     $this->middleware('auth');
     $this->auth = $auth;
     $this->group = new Group();
     $this->module = 'groups';
     $this->module_name = 'Grupos';
     $this->sections = Section::Active();
 }
 public function run()
 {
     Model::unguard();
     DB::table('sections')->truncate();
     //Seccion principal
     Section::create(['id' => 1, 'name' => 'Pronueva', 'code' => 'pb', 'url' => '', 'section_id' => '0', 'status' => '1', 'weight' => '1', 'icon' => 'et-circle-compass']);
     Section::create(['id' => 2, 'name' => 'Usuarios', 'code' => 'pb_users', 'url' => '/users', 'section_id' => '1', 'status' => '1', 'weight' => '1']);
     Section::create(['id' => 3, 'name' => 'Empresas', 'code' => 'pb_companies', 'url' => '/companies', 'section_id' => '1', 'status' => '1', 'weight' => '1']);
     Section::create(['id' => 4, 'name' => 'Grupos', 'code' => 'pb_groups', 'url' => '/groups', 'section_id' => '1', 'status' => '1', 'weight' => '1']);
     //Seccion CMS
     $section = Section::create(['name' => 'CMS', 'code' => 'cms', 'url' => '', 'section_id' => '0', 'status' => '1', 'weight' => '1', 'icon' => 'et-newspaper']);
     Section::create(['name' => 'Categorías', 'code' => 'cms_category', 'url' => '/cms_categories', 'section_id' => $section->id, 'status' => '1', 'weight' => '1']);
     Section::create(['name' => 'Secciones', 'code' => 'cms_section', 'url' => '/cms_sections', 'section_id' => $section->id, 'status' => '1', 'weight' => '1']);
     Section::create(['name' => 'Articulos', 'code' => 'cms_article', 'url' => '/blog', 'section_id' => $section->id, 'status' => '1', 'weight' => '1']);
 }
 public function run()
 {
     Model::unguard();
     DB::table('groups')->truncate();
     Group::create(['id' => 1, 'name' => 'administrador', 'permission' => '', 'status' => '1']);
     Group::create(['id' => 2, 'name' => 'cliente', 'permission' => '', 'status' => '1']);
     $sections = \Pronueva_back\Section::Active();
     foreach ($sections as $section) {
         $a[$section->code] = 1;
         $section_child = \Pronueva_back\Section::where('section_id', $section->id)->get();
         foreach ($section_child as $child) {
             $a[$child->code] = 1;
         }
     }
     $group = Group::find(1);
     $group->permission = json_encode($a);
     $group->save();
 }
Exemplo n.º 4
0
            <div class="col-md-12">
                <div class="col-md-4 margin-top-20 line-height-40">
                    {!! Form::label('Empresa *') !!}
                </div>
                <div class="col-md-8 margin-top-20">
                    {!! Form::select('company',$companies,array('')) !!}
                </div>
            </div>
            <div class="col-md-12">
                    <!--div class="col-md-4 margin-top-20 line-height-40">
                    {!! Form::label('Permisos *') !!}
                    </div>
                    <div class="col-md-8 margin-top-20">
                        @foreach($sections as $section)
                            <?php 
$section_child = \Pronueva_back\Section::where('section_id', $section->id)->get();
?>
                                <input type="hidden" id="{{$section->code}}"  value="{{$section->code}}" name="permission[{{$section->code}}]">

                            @foreach($section_child as $schild)
                                <div class="col-md-4">
                                    {{$schild->name}}
                                        <input type="hidden" id="{{$schild->code}}" disabled value="permission[{{$schild->code}}]" name="permission[{{$schild->code}}]">
                                    <label class="switch switch-info switch-round">
                                        <input type="checkbox" id="permission" name="{{$schild->code}}" >
                                        <span class="switch-label" data-on="Si" data-off="no"></span>
                                    </label>
                                </div>
                            @endforeach
                        @endforeach
                    </div -->