@extends('layouts.main_layout') @php $title = 'Add Access Level'; $name = ''; $oldPermissions = []; if(!empty($role)){ $name = $role->name; $oldPermissions = $role->permissions->pluck('id')->toArray(); } if(!empty(old('name'))){ $name = old('name'); $oldPermissions = old('permissions'); $role_ds = old('sections'); } @endphp @section('title','RCSA - '.$title) @section('main-content') Add Access Level @if(!empty($role)) @method('PUT') @else @endif @csrf Add Access Level Select All Permission Add Edit Delete View @foreach($modules as $module=>$permissions) {{ucwords(str_replace('_',' ',$module))}} @php $prms = ['add','edit','delete','view'] ; @endphp @foreach($prms as $permission) @php $count = 0; @endphp @foreach($permissions as $p) @if($p->name == $module.'.'.$permission) @php $count++; @endphp id,$oldPermissions)) checked="true" @endif> @endif @endforeach @if($count <1) @endif @endforeach @endforeach Dashboard Element @foreach($dsections as $section) @php $checked =''; if(!empty($role_ds) && in_array($section->id,$role_ds)){ $checked = 'checked = "checked"'; } @endphp {{$section->name}} @endforeach Cancel Save @endsection @section('additionalJs') @endsection