Answer the question
In order to leave comments, you need to log in
I send a photo to the server and I get null in the output?
<form action="{{ url('AddProduct') }}" method="post" enctype="multipart/form-data">
@csrf
<div class="new-customers p-30">
<div class="row">
<div class="col-sm-6">
<input type="text" placeholder="Product Name" name="productName">
</div>
<div class="col-sm-6">
<input type="text" placeholder="Model" name="productType">
</div>
<div class="col-sm-6">
<select class="custom-select" name="category">
<option value="defalt">Category</option>
<option value="c-1">Notebook</option>
<option value="c-2">SmartPhone</option>
<option value="c-3">Acessory</option>
<option value="c-4">...</option>
</select>
</div>
<div class="col-sm-6">
<input type="text" placeholder="Price..." name="price">
</div>
</div>
<input type="text" placeholder="Count..." name="count">
<!--Upload product photo -->
<div class="wrapper upload-photo">
<div class="container" style="max-width:100%;margin-left:20px;margin-bottom:20px;">
<div class="row">
<div class="col-2" style="margin-right:33px;">
<div class="box" style="height:120px;">
<div class="js--image-preview"></div>
<div class="upload-options">
<label class="upload-lbl">
<input type="file" class="product-image-upload" accept="image/*" name="productPhoto1" multiple/>
</label>
</div>
</div>
</div>
</form>
<?php
namespace App\Http\Controllers;
use Redirect;
use Illuminate\Http\Request;
class ProductController extends Controller
{
public function AddProduct(Request $r){
$data = $r->file('');
dd($data);
return Redirect::to('my-account');
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question