@extends('layouts.app') @section('content')

Edit Team Member

{{ $company->name }} - Update user: {{ $user->name }}

Back to Team Members
@if(session('success')) @endif @if(session('error')) @endif
@csrf @method('PUT')
Basic Information
@error('name')
{{ $message }}
@enderror
@error('email')
{{ $message }}
@enderror
@error('password')
{{ $message }}
@enderror Leave blank to keep current password. Minimum 8 characters if changing.
@php $currentUserRole = auth()->user()->role; $isSuperAdmin = auth()->user()->isSuperAdmin(); $canChangeRole = false; $availableRoles = []; // Determine what roles current user can assign if ($isSuperAdmin) { $canChangeRole = true; $availableRoles = ['hr', 'manager', 'staff']; } elseif ($currentUserRole === 'hr') { // HR can only change roles for managers and staff if (in_array($user->role, ['manager', 'staff'])) { $canChangeRole = true; $availableRoles = ['manager', 'staff']; } } elseif ($currentUserRole === 'manager') { // Manager can only change role for staff if ($user->role === 'staff') { $canChangeRole = true; $availableRoles = ['staff']; } } // Users cannot change their own role unless they are super admin if ($user->id === auth()->id() && !$isSuperAdmin) { $canChangeRole = false; } @endphp @if($canChangeRole) @else You cannot change this user's role @endif @error('role')
{{ $message }}
@enderror Company Admin: Full access to all company operations
Manager: Approval permissions for leaves, expenses
Staff: Basic employee access
@if($websites->count() > 0)
Website Access
HR users have automatic access to all websites. Select websites for Manager and Staff roles.
@foreach($websites as $website) @php $isAssigned = in_array($website->id, $assignedWebsites); $currentPermission = $user->assignedWebsites()->where('website_id', $website->id)->value('permission') ?? 'read'; @endphp @endforeach
Access Website Permission Level
@error('website_ids')
{{ $message }}
@enderror
@endif
Cancel
User Information
Created:
{{ $user->created_at->format('M d, Y') }}
Last Updated:
{{ $user->updated_at->format('M d, Y') }}
Current Role:
@if($user->role === 'hr') Company Admin @elseif($user->role === 'manager') Manager @else Staff @endif
Website Access:
{{ $user->assignedWebsites->count() }} websites
Role Permissions
Company Admin
  • Full access to all company operations
  • Manage employees and HR functions
  • Access all websites
  • Process payroll and manage benefits
Manager
  • Approve leave requests and expenses
  • Manage team performance reviews
  • Access assigned websites
  • View team reports and analytics
Staff
  • Basic employee access
  • Submit leave requests and expenses
  • Clock in/out for attendance
  • View personal HR information
Permission Levels
Admin Full control including settings and user management
Write Can edit content, pages, and website data
Read View-only access to website content
@push('scripts') @endpush @endsection