2018-09-16 19:18:49 +00:00
|
|
|
<p><strong>Users:</strong></p>
|
|
|
|
@forelse ($users as $user)
|
|
|
|
@if (!$loop->first)
|
|
|
|
<hr>
|
|
|
|
@endif
|
2018-09-17 18:22:49 +00:00
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="form-group row mr-1">
|
|
|
|
<div class="col-xs-12 col-sm-10 col-lg-11 mb-2">
|
|
|
|
{{ $user->name }} ({{ $user->email}})
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12 col-sm-2 col-lg-1">
|
|
|
|
<form method="POST" action="/user">
|
|
|
|
{{ csrf_field() }}
|
|
|
|
@method('DELETE')
|
|
|
|
<input type="hidden" name="item_id" id="item_id" value="{{ $item['id'] }}">
|
|
|
|
<input type="hidden" class="form-control" name="user_id" id="user_id" value="{{$user->id}}">
|
|
|
|
<button type="submit" class="btn btn-sm btn-danger">Delete</button>
|
|
|
|
</div>
|
2018-09-16 19:18:49 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-17 18:22:49 +00:00
|
|
|
</form>
|
2018-09-16 19:18:49 +00:00
|
|
|
@empty
|
|
|
|
<p>There are no items yet. Include one with the form above.</p>
|
|
|
|
@endforelse
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ADD USERS -->
|
2018-09-17 18:22:49 +00:00
|
|
|
<hr class="mt-5">
|
|
|
|
<p><strong>Add user</strong></p>
|
|
|
|
<form method="POST" action="/user">
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="form-group row mt-2">
|
2018-09-16 19:18:49 +00:00
|
|
|
{{ csrf_field() }}
|
2018-09-17 18:22:49 +00:00
|
|
|
<div class="col-sm-2 col-lg-1"><label for="name">E-mail: </label></div>
|
|
|
|
<div class="col-xs-12 col-sm mb-3"><input type="email" class="form-control" name="email" id="email" placeholder="name@domain.com" required></div>
|
2018-09-16 19:18:49 +00:00
|
|
|
<input type="hidden" name="item_id" id="item_id" value="{{ $item['id'] }}" required>
|
2018-09-17 18:22:49 +00:00
|
|
|
<div class="col-sm-2 col-lg-1 mr-4"><button type="submit" class="btn btn-primary">Insert</button></div>
|
2018-09-16 19:18:49 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-17 18:22:49 +00:00
|
|
|
</form>
|
2018-09-16 19:18:49 +00:00
|
|
|
@include ('layouts.errors')
|