@extends('layouts.app') @section('title', 'Edit User') @section('content')

Edit User

@csrf @method('PUT')
@error('name') {{ $message }} @enderror
@error('email') {{ $message }} @enderror
@error('phone_number') {{ $message }} @enderror
@error('user_code') {{ $message }} @enderror
@if($user->thumbnail) Thumbnail @endif @error('thumbnail') {{ $message }} @enderror
@if(auth()->id() !== $user->id)
@error('status') {{ $message }} @enderror
@endif @if(!$user->hasRole('Super Admin'))
@error('role') {{ $message }} @enderror
@endif
{{--
Cancel
--}}
{{-- @include('modules.role.bulk_permissions_checkbox', ['modules' => $permissionsByModule]) --}} @php $supersubset = $permissions->pluck('id')->toArray(); $userPermissionsIds = $user->permissions()->pluck('permission_id')->toArray(); @endphp
@error('permissions') {{ $message }} @enderror
is_default_permission) checked @endif>
@foreach($permissionsByModule as $module) @php $subset = $module->permissions->pluck('id')->toArray(); $moduleName = strtolower(str_replace(' ', '_', $module->name)); $userPermissions = $user->permissions()->whereHas('module', function($query) use ($module) { $query->where('name', $module->name); })->get()->pluck('id')->toArray(); @endphp
@foreach($module->permissions as $key => $permission)
permissions()->where('name', $permission->name)->first()) checked @endif @if(!$permission->isActive) disabled @endif>
@endforeach
@endforeach
Cancel
@endsection @section('page-specific-script') @endsection