Level 7
that's not how laravel work.
just
return $request->defect_type;
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
This is my ajax,
$scope.update_defects = function(){
var file_data = $('#fileaudio').prop('files')[0];
var file_data1 = $('#filevideo').prop('files')[0];
var form_data = new FormData();
form_data.append('file', file_data);
form_data.append('file1', file_data1);
form_data.append('snag_id', $scope.projectSnagId);
form_data.append('defect_id', $scope.defect_number);
form_data.append('defect_type', $scope.defect_type);
form_data.append('defect_desc', $scope.defect_desc);
$http({
url:"{{url('update_si_defects')}}",
method:"POST",
data:form_data,
}).success(function(data,status,config,header){
}).error(function(data,status,config,header){
alert("Defect data retrival error");
});
}
This is my laravel controller,
public function update_si_defects(Request $request)
{
echo $request->defect_type;
exit();
}
But i am unable to get the submitted values in controller, what is the correct way? please suggession any solution?
Please or to participate in this conversation.