@extends('layouts.backend') @section('title', '| Edit Role') @section('content')
@if (count($errors) > 0)
Something went wrong.

@endif

Edit Role

{!! Form::model($role, ['method' => 'PATCH','route' => ['roles.update', $role->id]]) !!}
{!! Form::text('name', null, array('placeholder' => 'Name','class' => 'form-control')) !!}

@foreach($permission as $value) {{-- Check if the role is not 'user' --}} @if(($role->slug !== 'customer') && (!in_array($value->id, [3, 4, 9,17]))){{--Changed condition by Gurupriya on 5 April 2024 previous it was @if($role->slug !== 'user'). Because dont need to give "role permission" things to Admin. Only super admin has this access--}} {{-- Display checkboxes for permissions --}}
@else {{-- Display checkboxes only for permissions the user already has --}} @if(in_array($value->id, $rolePermissions) && ($value->id !== 17)){{--Changed condition by Gurupriya on 5 April 2024 previos it was @if(in_array($value->id, $rolePermissions)) . Because dont need to give "role permission" things to Admin. Only super admin has this access--}}
@endif @endif @endforeach
{!! Form::close() !!}
@endsection @section('js') @endsection