mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-24 04:14:57 +00:00
42 lines
1.5 KiB
PHP
42 lines
1.5 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-8">
|
|
|
|
<form method="POST" action="/product" class="form-inline">
|
|
<div class="form-group">
|
|
{{ csrf_field() }}
|
|
<div class="col"><label for="product">Add Product: </label></div>
|
|
<div class="col-6"><input type="text" class="form-control" name="product" id="product" placeholder="Book" required></div>
|
|
<div class="col"><button type="submit" class="btn btn-primary">Insert</button></div>
|
|
</div>
|
|
@include ('layouts.errors')
|
|
</form>
|
|
|
|
<div class="card mt-4">
|
|
<div class="card-header">Products</div>
|
|
|
|
<div class="card-body">
|
|
@if (session('status'))
|
|
<div class="alert alert-success" role="alert">
|
|
{{ session('status') }}
|
|
</div>
|
|
@endif
|
|
|
|
<ul>
|
|
@forelse ($products as $product)
|
|
<li><a href="/product/{{$product['id']}}">{{$product['name']}}</a></li>
|
|
@empty
|
|
<p>There are no products yet. Include one with the form above.</p>
|
|
@endforelse
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|