dd(Input:all())
时,我会从表单中获取所有提交的值,这是它的快照。
这是我的功能,我试图将数据插入数据库
$product = new Products;
$product->user_id = Auth::user()->id;
$product->category_id = $idOfCategory;
$product->subcategory_id = $idOfSubCategory;
$product->title = Input::get('title');
$product->product_slug = str_slug(Input::get('title'));
$product->description = Input::get('description');
$product->runtime = Input::get('runtime');
$product->adtype = Input::get('adtype');
$product->location = Input::get('location');
$product->price = Input::get('price');
$product->image1 = $fileName1;
$product->image2 = $fileName2;
$product->image3 = $fileName3;
$product->negotiable = Input::get('negotiable');
$product->product_condition = Input::get('product_condition');
$product->usedfor = Input::get('usedfor');
$product->detailurl = Input::get('detailurl');
$product->status = 'available';
$product->save();
这是我的产品型号
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Products extends Model
{
protected $table = 'products';
}
可能是什么问题?