mouzak
200
2
Laravel

(1/1) FatalErrorException Maximum execution time of 60 seconds exceeded

Posted 2 months ago by mouzak

hello, the execution of my query is very slow so I have this error (1/1) FatalErrorException Maximum execution time of 60 seconds exceeded. Please help me optimize it. Thank you.

controller public function importCSV(Request $request) {

           if($request->file('csv_file')) {
               $path = $request->file('csv_file')->getRealPath();
               $data = Excel::load($path, function ($reader) {
               })->get();

               if (!empty($data) && $data->count()) {
                   $data = $data->toArray();
                   for ($i = 0; $i < count($data); $i++) {
                       $dataImported[] = $data[$i];
                   }
               }
               bareme::insert($dataImported);

               return back();
           }
        else {
           return view('baremeIR');
       }


   }

Please sign in or create an account to participate in this conversation.