problems with excel function. larvel 5.5

Posted 4 weeks ago by daniel21gt

How about, I have an excel function, which when sending any filter like for example, result1 or result2, this generates an excel with one of those two variables, this works very well in browser opera, but does not work in google chrome or mozilla , since these two are left with the first excel that I download, that is, if I filter with another variable, it still downloads the first excel that it downloads, does anyone know what this is?

public function excelgobernadores(Request $request) {

   $registrado = \Auth::user()->tipos_usuarios_id;
   $filtros = \Auth::user()->username;
   

   if($registrado == 1)

    {

      $request->user()->authorizeRoles(['admin']);

    
        $urlgover = request()->headers->get('referer');
         parse_str(parse_url($urlgover)['query'], $output);
          $valorgober = $output['governore'];


        Excel::create('ExcelGobernadores', function($excelgobernadores) use ($valorgober){
            $excelgobernadores->sheet('Excelsheet', function($sheet) use ($valorgober){
    
              $conteogobe = usuarios::join('governor', 'usuarios.gobe_id', '=' , 'governor.idg')->where('gobe_id',$valorgober)->where('asignacion', '<>', '')->select('user_id', 'user_id', 'usuario_ad', 'nombre', 'apellido', 'cedula', 'telefonos', 'direccion', 'barrio', 'lugar_votacion', 'mesa_votacion', 'email', 'ciudad', 'comentario', 'asignacion', 'estado', 'governor.governor_candidate')->get();
              $conteogobe = json_decode( json_encode($conteogobe), true);
              $sheet->fromArray($conteogobe);
              $sheet->setOrientation('landscape');

           });

        })->export('xls');
    
   }

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

Reply to

Use Markdown with GitHub-flavored code blocks.