first commit
This commit is contained in:
71
resources/views/product/create.blade.php
Normal file
71
resources/views/product/create.blade.php
Normal file
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Product create</title>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 margin-tb">
|
||||
<div class="pull-left mb-2">
|
||||
<h2>Add product</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-primary" href="{{ route('products.index') }}"> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(session('status'))
|
||||
<div class="alert alert-success mb-1 mt-1">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{ route('products.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<strong>Product Name:</strong>
|
||||
<input type="text" name="name" class="form-control" placeholder="Product Name">
|
||||
@error('name')
|
||||
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<strong>Product article:</strong>
|
||||
<input type="text" name="article" class="form-control" placeholder="Product article">
|
||||
@error('article')
|
||||
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<strong>Product Price:</strong>
|
||||
<input type="text" name="price" class="form-control" placeholder="Company Price">
|
||||
@error('price')
|
||||
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<strong>Product quantity:</strong>
|
||||
<input type="number" name="quantity" class="form-control" placeholder="Company quantity">
|
||||
@error('quantity')
|
||||
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary ml-3">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
68
resources/views/product/edit.blade.php
Normal file
68
resources/views/product/edit.blade.php
Normal file
@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Edit Product</title>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 margin-tb">
|
||||
<div class="pull-left">
|
||||
<h2>Edit Product</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-primary" href="{{ route('products.index') }}" enctype="multipart/form-data">
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(session('status'))
|
||||
<div class="alert alert-success mb-1 mt-1">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{ route('products.update',$product->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<strong>Product Name:</strong>
|
||||
<input type="text" name="name" value="{{ $product->name }}" class="form-control"
|
||||
placeholder="Product name">
|
||||
@error('name')
|
||||
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<strong>Product price:</strong>
|
||||
<input type="text" name="price" class="form-control" placeholder="Product price"
|
||||
value="{{ $product->price }}">
|
||||
@error('price')
|
||||
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<strong>Product quantity:</strong>
|
||||
<input type="text" name="quantity" value="{{ $product->quantity }}" class="form-control"
|
||||
placeholder="Product quantity">
|
||||
@error('quantity')
|
||||
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary ml-3">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
57
resources/views/product/index.blade.php
Normal file
57
resources/views/product/index.blade.php
Normal file
@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Products</title>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" >
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 margin-tb">
|
||||
<div class="pull-left">
|
||||
<h2>Products</h2>
|
||||
</div>
|
||||
<div class="pull-right mb-2">
|
||||
<a class="btn btn-success" href="{{ route('products.create') }}"> Create Product</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Article</th>
|
||||
<th>Name</th>
|
||||
<th>price</th>
|
||||
<th>quantity</th>
|
||||
<th width="280px">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($products as $product)
|
||||
<tr>
|
||||
<td>{{ $product->article }}</td>
|
||||
<td>{{ $product->name }}</td>
|
||||
<td>{{ $product->price }}</td>
|
||||
<td>{{ $product->quantity }}</td>
|
||||
<td>
|
||||
<form action="{{ route('products.destroy',$product->id) }}" method="Post">
|
||||
<a class="btn btn-primary" href="{{ route('products.edit',$product->id) }}">Edit</a>
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{!! $products->links() !!}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user