Current File : //home/tradevaly/public_html/resources/views/backend/pages/userManagement/role/index.blade.php
@extends('backend.ayaan.master')

@push('title') Roles @endpush
@section('css')
    <!-- DataTables -->
    <link href="{{ asset('/assets/libs/datatables/datatables.min.css') }}" rel="stylesheet" type="text/css" />
@endsection
@section('content')

    @component('components.breadcrumb')
        @slot('li_1') Dashboards @endslot
        @slot('title') Roles @endslot
    @endcomponent
    
    
    
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <div class="row mb-2">
                        <div class="col-sm-4"></div>
                        <div class="col-sm-8">
                            <div class="text-sm-end">
                                <a href="{{ route('admin.user_namagement.role.create') }}"
                                    class="btn btn-success btn-rounded waves-effect waves-light mb-2 me-2"><i
                                        class="mdi mdi-plus me-1"></i> Create New Role</a>
                            </div>
                        </div><!-- end col-->
                    </div>

                    <div class="table-responsive">
                        <table id="datatable-buttons" class="table table-bordered dt-responsive nowrap w-100">
                            <thead class="table-light text-center">
                                <tr>
                                  <th class="text-center">SL</th>
                                  <th>{{translate('Name')}}</th>
                                  <th>{{translate('Permissions')}}</th>
                                  <th>{{translate('Actions')}}</th>
                                </tr>
                            </thead>
                            <tbody class="text-center">
                                @foreach($roles as $role)
                               <tr>
                                 <td> {{ $role->index }}</td>
                                 <td> {{ $role->name }}</td>
                                 <td>
                                     @foreach($role->get_permissions as $permission)
                                     <span class="badge bg-info">{{ $permission->permission->name}}</span>
                                     @endforeach
                                 </td>
                                 <td>
                                     <a class="btn btn-danger btn-sm" href="{{ route('admin.user_namagement.role.destroy', $role->id) }}">Delete</a>
                                     <a class="btn btn-info btn-sm" href="{{ route('admin.user_namagement.role.show', $role->id) }}">Edit</a>
                                 </td>
                               </tr>
                                @endforeach
                            </tbody>
                        </table>
                    </div>
                    
                </div>
            </div>
        </div>
    </div>
    <!-- end row -->
    
    
@endsection