I use ajax to get data json and send it to my controller, now I want to insert this data into table pointages help me please wher is the error. here is ajax code:
he give me this error 
$('.add-all').on('click', function() {
var items = [];
let valu = $('#datePicker').val();
$("tr").each(function(i,r){
if ( i > 0 && $(r).find("input").first().prop("checked"))
{
items.push({"matricule": r.cells[3].innerText, "salaire": r.cells[5].innerText, "date" : valu })
}
});
//ajax
$.ajax({
method : 'POST',
url : 'mois',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data : {"items":items}, // pass in json format
success : function(data) {
console.log(data);
},
error : function(err){
console.log(err)
}
});
//fin ajax
});
Controller:
public function addMultiple(Request $request){
foreach($request->get('items') as $item){
$pointage = Pointage::create([
'matricule' => $item->$item['matricule'],
'datep' => $item->$item['datep'],
'solde' => $item->$item['salaire']
]);
}
return redirect("mois");
}
modele Pointage :
class Pointage extends Model
{
/**
*
*
* @var array
*/
protected $fillable = [
'matricule', 'datep', 'solde',
];
}
table pointages:the other fields is nullable
public function up()
{
Schema::create('pointages', function (Blueprint $table) {
$table->increments('id');
$table->integer('matricule');
$table->date('datep');
$table->double('nbrj');
$table->double('prime');
$table->double('solde');
$table->timestamps();
});
}
dd($item['matricule'])before create? You have to see what type of data you have in$item.'matricule' => $item['matricule'], instead of ` 'matricule' => $item->$item['matricule']`.