store foreign key as zero instead of it's value
store foreign key as zero instead of it's value I have a table that all the values are foreign keys ,when I store these values it save it as zero not the value that I chose , public function create() { $type=type::query()->pluck('type'); $color=color::query()->pluck('colore'); $region=region::query()->pluck('country'); $size=size::query()->pluck('size'); $brand=brand::query()->pluck('company'); //$price=new_product::query()->pluck('price'); return view('sale',compact('type','color','region','size','brand')); } public function store(Request $request) { new_product::create($request->all()); return redirect()->route('sale.index'); } the model: class new_product extends Model { protected $table = 'enter_new_product'; protected $fillable = ['type_id', 'color_id', 'region_id', 'size_...