@extends('layouts.app')
@section('title', __('Users & Roles'))
@section('content')<div class="row g-3"><div class="col-lg-4"><div class="card"><div class="card-body p-4"><h6>{{ __('Add User') }}</h6><form method="POST" action="{{ route('users.store') }}">@csrf<input name="name" class="form-control mb-2" placeholder="{{ __('Full Name') }}" required><input name="email" type="email" class="form-control mb-2" placeholder="Email" required><input name="password" type="password" class="form-control mb-2" placeholder="{{ __('Password') }}" required><select name="role" class="form-select mb-2">@foreach($roles as $role)<option value="{{ $role }}">{{ ucfirst($role) }}</option>@endforeach</select><button class="btn btn-success w-100">{{ __('Create User') }}</button></form></div></div></div><div class="col-lg-8"><div class="card"><div class="card-body"><p class="text-muted small">Manager: full access · Cashier: sales/payments · Storekeeper: stock/purchases · Accountant: finance/reports.</p><table class="table"><thead><tr><th>{{ __('User') }}</th><th>Email</th><th>{{ __('Role') }}</th><th></th></tr></thead><tbody>@foreach($users as $user)<tr><td>{{ $user->name }}</td><td>{{ $user->email }}</td><td><form method="POST" action="{{ route('users.role',$user) }}" class="d-flex gap-2">@csrf @method('PUT')<select name="role" class="form-select form-select-sm">@foreach($roles as $role)<option value="{{ $role }}" @selected($user->role===$role)>{{ ucfirst($role) }}</option>@endforeach</select><button class="btn btn-light btn-sm">{{ __('Save') }}</button></form></td></tr>@endforeach</tbody></table></div></div></div></div>@endsection
