Not getting any error while uploading the file in the database
I am trying to store multiple files in the database in laravel but not getting any error, I also check with the dd in the backend but got nothing. I don't know how check. Can anyone help me how how to fix this?
The path in which I'm storing the diploma files is used to store another files so I am using same folder(storage/app/license) and I have created a folder under app (diploma) but it is also not working
$diplomaname = $request->get('diplomaname');
$diplomayear = $request->get('diplomayear');
$all_params = $request->keys();
$total_diplomas = preg_grep('/^diplomafile_.*/', $all_params);
if ($diplomaname != null && $diplomayear != null) {
$dip = new Diplomas();
$dip->lawyer_id = $lawyer-> id;
$dip->diploma_institution = $diplomaname;
$dip->year = $diplomayear;
$dip->save();
}
for ($j = 0; $j < count($total_diplomas); $j++) {
if ($request->get('diplomafile_'.$j) != null) {
$filename = $request-> file('diplomafile_'.$j)->store('licenses');
$dipfile = new Diplomafile();
$dipfile->lawyer_id = $lawyer->id;
$dipfile->file = $filename;
$dipfile->save();
}
}
ia hve created separate table to store files as they are multiple ,please help with this i am on this since last 2 days, i am not even getting any error,earlier i was gettting error 'call to member function store null' but as made changes in my frontend jquery & ajax code so that error is not coming and also done severals dd() but got nothing