When I am importing data from excel after getting the file and on the step of saving data to db it showing field doesn't have value from excel file. Where as all the fields are filled with data.
i am using laravel excel
LeadImport Code
return new lead([
'name' => $row[0],
'leadid' => $row[1],
'number' => $row[2],
'city' => $row[3],
'state' => $row[4],
'address' => $row[5],
'pincode' => $row[6],
'type' => $row[7],
]);
Controller Code
Excel::import(new LeadsImport, $request->file('file'));
Error
SQLSTATE[HY000]: General error: 1364 Field 'leadid' doesn't have a default value (SQL: insert into `leads` (`updated_at`, `created_at`) values (2022-01-14 19:24:21, 2022-01-14 19:24:21))