Answer the question
In order to leave comments, you need to log in
How to increase the waiting time?
When using the script:
public function createCat(Request $request)
{
if(($request->file('files'))) {
$Category = new Category();
$files=$request->file('files');
$name=$files->getClientOriginalName();
$filename=date('Y-m-d-H:i:s')."-".$files->getClientOriginalName();
$path='upload/xls/';
$files->move($path,$filename);
$ffile='upload/xls/'.$filename;
$results=Excel::selectSheets('Категории')->load($ffile)->get();
foreach ($results as $row) {
Category::create([
'post'=>$row->post,
'name'=>$row->name,
'numer'=>$row->numer, ]);}
$resultsCat=Excel::selectSheets('Под_категории')->load($ffile)->get();
foreach ($resultsCat as $row) {
podcat::create([
'post'=>$row->post,
'name'=>$row->name,
'numer'=>$row->numer, ]);}
Flash::success('Данные загружены');
return redirect('admin/upload');
} else {
Flash::success('Вы не выбрали фаил.');
return redirect('admin/upload');
}
}
Answer the question
In order to leave comments, you need to log in
Use queues, the user does not have to wait for a response, let it run in the background.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question