Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @extends('layout.app')
- @section('content')
- <style>
- .uper { margin-top: 40px; }
- </style>
- <div class="uper">
- @if(session()->get('success'))
- <div class="alert alert-success">
- {{ session()->get('success') }}
- </div><br />
- @endif
- <button class="btn btn-primary" onclick="window.location.href='./employees/create'" type="button">Add new employee</button>
- <table class="table table-striped">
- <thead>
- <tr>
- <td>Firstname</td>
- <td>Lastname</td>
- <td>Email</td>
- <td>Department</td>
- <td colspan="2">Action</td>
- </tr>
- </thead>
- <tbody>
- @foreach($employees as $employee)
- <tr>
- <td>{{$employee->firstname}}</td>
- <td>{{$employee->lastname}}</td>
- <td>{{$employee->email}}</td>
- <td>{{$employee->department}}</td>
- <td><a href="{{ route('employees.edit',$employee->id)}}" class="btn btn-primary">Edit</a></td>
- <td>
- <form action="{{ route('employees.destroy', $employee->id)}}" method="post">
- @csrf
- @method('DELETE')
- <button class="btn btn-danger" type="submit">Delete</button>
- </form>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- <div>
- @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement