:3
This commit is contained in:
37
resources/views/employees/edit.blade.php
Normal file
37
resources/views/employees/edit.blade.php
Normal file
@ -0,0 +1,37 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h1>Edit Employee</h1>
|
||||
|
||||
<form action="{{ route('employees.update', $employee) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="mb-3">
|
||||
<label for="first_name" class="form-label">First Name</label>
|
||||
<input type="text" class="form-control" id="first_name" name="first_name" value="{{ old('first_name', $employee->first_name) }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="last_name" class="form-label">Last Name</label>
|
||||
<input type="text" class="form-control" id="last_name" name="last_name" value="{{ old('last_name', $employee->last_name) }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="company_id" class="form-label">Company</label>
|
||||
<select class="form-select" id="company_id" name="company_id" required>
|
||||
@foreach($companies as $company)
|
||||
<option value="{{ $company->id }}" {{ $employee->company_id == $company->id ? 'selected' : '' }}>{{ $company->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input type="email" class="form-control" id="email" name="email" value="{{ old('email', $employee->email) }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="phone" class="form-label">Phone</label>
|
||||
<input type="text" class="form-control" id="phone" name="phone" value="{{ old('phone', $employee->phone) }}">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Update Employee</button>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
Reference in New Issue
Block a user