@extends('layouts.app') @section('title','Access Management') @section('content')
SETTINGS / SECURITY

People & Access

Employee accounts, teams, departments, roles and security activity in one workspace.

@if(session('activation_url'))
One-time employee activation link (valid 24 hours)

Copy this link now. It will not be displayed again.

@endif @if(session('success'))
{{ session('success') }}
@endif @if(isset($errors) && $errors->any())
{{ $errors->first() }}
@endif @if(!$company)
Create your company profile first to configure departments and roles.
@else

Employee Accounts

Create a company employee account and assign roles after activation. Existing users are listed below.

@csrf
@forelse($users as $user)@empty@endforelse
NameEmailCompany membershipAccount status
{{ $user->name }}{{ $user->email }}{{ $user->role }}{{ $user->is_active ? 'Active' : 'Inactive / pending activation' }}@if(\Illuminate\Support\Facades\DB::table('users')->where('id',auth()->id())->where('is_system_admin',true)->exists() && !$user->is_system_admin && $user->id!==auth()->id())
@csrf @method('PUT')Applies to all companies
@endif
No employees yet.

Teams & Groups

Organize employees by team, assign supervisors and manage membership.

@csrf

All teams {{ $teams->count() }}

@forelse($teams as $team)@php $supervisor=$users->firstWhere('id',$team->supervisor_user_id); @endphp@empty@endforelse
TeamSupervisorMembers
{{ $team->name }}{{ $team->code }}{{ $supervisor?->name??'Not assigned' }}{{ ($teamMembers[$team->id]??collect())->count() }}
No teams yet. Create your first team or add the optional templates.
☷

Select a team

Choose Manage next to a team to edit its supervisor or members.

@foreach($teams as $team)@endforeach

Security Activity Log

Search full audit history →

Recent recorded team and access-management changes, attributed to the signed-in employee.

@forelse($auditLogs as $log)
{{ $log->action }}
User #{{ $log->actor_user_id }} · {{ $log->created_at }} · {{ $log->subject_type }} #{{ $log->subject_id }}
@empty

No recorded activity yet.

@endforelse

Departments

@csrf
@forelse($departments as $department)
{{ $department->name }} · {{ $department->code }}
@empty

No departments yet.

@endforelse

Ready-made roles

Add Company Administrator, Branch Manager, Accountant, Warehouse Operator and Sales Representative. Existing roles stay unchanged. Assign scope and warehouse access separately.

@csrf
Create a custom roleChoose individual permissions
@csrf
Grant only the permissions this role needs:
@foreach($permissions as $permission)@endforeach

Existing Roles

@forelse($roles as $role)
@csrf @method('PUT')
{{ $role->name }}{{ ($grants[$role->id]??collect())->count() }} permissions · {{ $role->slug }}
@foreach($permissions as $permission)@endforeach
@empty

No roles created yet.

@endforelse

Assign Employee Role

@csrf

Current Assignments

@forelse($assignments as $assignment)
User #{{ $assignment->user_id }} · {{ $roles->firstWhere('id',$assignment->role_id)?->name }} · {{ $assignment->data_scope }}
@csrf @method('DELETE')
@empty

No assignments yet.

@endforelse
@endif @endsection