:3
This commit is contained in:
48
resources/views/employees/index.blade.php
Normal file
48
resources/views/employees/index.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h1>Employees</h1>
|
||||
<a href="{{ route('employees.create') }}" class="btn btn-primary mb-3">Add Employee</a>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Company</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($employees as $employee)
|
||||
<tr>
|
||||
<td>{{ $employee->first_name }}</td>
|
||||
<td>{{ $employee->last_name }}</td>
|
||||
<td>
|
||||
@if ($employee->company)
|
||||
{{ $employee->company->name }}
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $employee->email }}</td>
|
||||
<td>{{ $employee->phone }}</td>
|
||||
<td>
|
||||
<a href="{{ route('employees.show', $employee) }}" class="btn btn-info btn-sm">View</a>
|
||||
<a href="{{ route('employees.edit', $employee) }}" class="btn btn-warning btn-sm">Edit</a>
|
||||
<form action="{{ route('employees.destroy', $employee) }}" method="POST" style="display:inline;">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $employees->links() }}
|
||||
</div>
|
||||
@endsection
|
Reference in New Issue
Block a user