2018-09-10 04:23:32 +00:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="container">
|
|
|
|
<div class="row justify-content-center">
|
|
|
|
<div class="col-md-8">
|
|
|
|
|
|
|
|
<form method="POST" action="/item" class="form-inline">
|
|
|
|
<div class="form-group">
|
|
|
|
{{ csrf_field() }}
|
|
|
|
<div class="col"><label for="product">Add Item: </label></div>
|
2018-09-11 00:29:32 +00:00
|
|
|
<div class="col-6"><input type="text" class="form-control" name="item" id="item" placeholder="One Hundred Years of Solitude" required></div>
|
2018-09-11 23:48:09 +00:00
|
|
|
<input type="hidden" name="product_id" id="product_id" value="{{ $product['id'] }}" required>
|
2018-09-10 04:23:32 +00:00
|
|
|
<div class="col"><button type="submit" class="btn btn-primary">Insert</button></div>
|
|
|
|
</div>
|
2018-09-11 00:29:32 +00:00
|
|
|
@include ('layouts.errors')
|
2018-09-10 04:23:32 +00:00
|
|
|
</form>
|
|
|
|
|
2018-09-11 00:29:32 +00:00
|
|
|
<div class="card mt-4">
|
2018-09-10 04:23:32 +00:00
|
|
|
<div class="card-header">
|
|
|
|
Product: <strong>{{$product['name']}}</strong>
|
2018-09-13 00:28:39 +00:00
|
|
|
@include ('product.buttons')
|
2018-09-10 04:23:32 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
@if (session('status'))
|
|
|
|
<div class="alert alert-success" role="alert"> {{ session('status') }}
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2018-09-13 00:28:39 +00:00
|
|
|
<strong>Items:</strong>
|
2018-09-10 04:23:32 +00:00
|
|
|
<ul>
|
2018-09-11 23:48:09 +00:00
|
|
|
@forelse ($product->items as $item)
|
|
|
|
<li><a href="/item/{{ $item->id }}">{{ $item->name }}</a></li>
|
2018-09-10 04:23:32 +00:00
|
|
|
@empty
|
|
|
|
<p>There are no items yet. Include one with the form above.</p>
|
|
|
|
@endforelse
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|