@extends('layouts.template.main') @section('content')
Danh sách nhân viên (HR)
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
{{-- --}} @foreach($employees as $employee) {{-- --}} {{-- ---------- If the users role is admin then hr won't be able to modify or remove data ---------- --}} @if($employee->user->hasRole('admin')) @else @endif @endforeach
ID Name Email Chức danh Bộ phận Phone Ngày bắt đầu làm việcSalaryStatus Role Actions
{{ $employee->user->id }} {{ $employee->user->name }} {{ $employee->user->email }} {{ $employee->designation }} {{ $employee->department }} {{ $employee->phone }} {{ $employee->joining_date ? \Carbon\Carbon::parse($employee->joining_date)->format('d/m/Y') : '' }}{{ number_format($employee->salary, 2) }}/- @if($employee->status == 'active') Active @else Inactive @endif {{ $employee->user->roles->pluck('name')->implode(', ') }} {{-- -------------------------------- Delete with confirmation -------------------------------- --}} {{--
--}} {{-- @csrf--}} {{-- @method('DELETE')--}} {{-- --}} {{--
--}} {{-- -------------------------------- Delete with confirmation -------------------------------- --}}
{{ $employees->links('pagination::bootstrap-5') }}
@endsection