%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/calling_code/resources/views/backend/super-admin/pages/system/roles/
Upload File :
Create Path :
Current File : //home/silvzytp/calling_code/resources/views/backend/super-admin/pages/system/roles/form.blade.php

@extends('layouts.backend')
@section('title', $siteTitle)
@section('action')
    <button type="submit" class="btn btn-sm btn-primary submit-form-btn">Save Change</button>
@endsection
@push('styles')

@endpush

@section('content')
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="mb-0 card-title">New Role</h4>
                </div>
                <div class="card-body">
                    <form action="{{ isset($role) ? route('super.roles.update', $role->id) : route('super.roles.store') }}" id="form" method="POST">
                        @csrf
                        @isset($role)
                            @method('PUT')
                        @endisset

                        <x-form.selectbox name="role_name" labelName="Role name" required="required">
                            <option value="">Select Role</option>
                            @forelse ($roles as $value)
                                <option value="{{ $value->name }}" @isset($role) {{ $role->name == $value->name ? 'selected' : '' }}  @endisset>{{ $value->name }}</option>
                            @empty

                            @endforelse
                        </x-form.selectbox>

                        <div class="permissions mb-5">
                            <h6 class="mb-0 text-center">Manage permissions for role</h6>
                        </div>
                        <div class="row">
                            <div class="col-12">
                                <div class="form-group ml-3">
                                    <div class="custom-control custom-checkbox">
                                        <input type="checkbox" class="custom-control-input select-all" id="all">
                                        <label class="custom-control-label" for="all">Select All</label>
                                    </div>
                                </div>
                            </div>

                            @forelse ($modules->chunk(3) as $module)
                                @foreach ($module as $value)
                                    <div class="col-md-4 mb-3">
                                        <h6 class="mb-0">{{ $value->name }}</h6>
                                        <div class="ml-3 mt-3">
                                            @foreach ($value->permissions as $permission)
                                                <div class="form-group">
                                                    <div class="custom-control custom-checkbox">
                                                        <input type="checkbox" name="permission[]" class="custom-control-input" id="role-select-{{ $permission->id }}" value="{{ $permission->id }}"

                                                        @isset($role)
                                                            @foreach ($role->permissions as $r_permission)
                                                                {{ $r_permission->id == $permission->id ? 'checked' : '' }}
                                                            @endforeach
                                                        @endisset
                                                        >

                                                        <label class="custom-control-label" for="role-select-{{ $permission->id }}">{!! $permission->name !!}</label>
                                                    </div>
                                                </div>
                                            @endforeach
                                        </div>
                                    </div>
                                @endforeach
                            @empty

                            @endforelse
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection

@push('scripts')
    <script>
        $(document).on('click', 'input.select-all', function(){
            if (this.checked) {
                $(':checkbox').each(function(){
                    this.checked = true;
                })
            }else{
                $(':checkbox').each(function(){
                    this.checked = false;
                })
            }
        })
    </script>
@endpush

Zerion Mini Shell 1.0