Laravel - Pass more than one parameter using use in callback functions?

Asked

Viewed 193 times

0

The thing is, I have a job callback of that kind:

\Excel::create($limite_vagas_array[0]['nome_curso']
          .' - '.$limite_vagas_array[0]['nome_polo']
          .' - Limite de vagas', function($excel) use ($limite_vagas_array)
        {
            $excel->sheet('sheet', function($sheet) use ($limite_vagas_array)
           {
                //#code
           }
        });

In the use call the array $limite_vagas_array, however I would like to spend another array.

How do I do that?

  • Your question is meaningless, can you pass as many as you want? what is the difficulty?

  • I wanted to pass another array. Type use ($limite_vagas_array, $outro_array)... I tried this but it didn’t work. What’s the syntax?

  • 1

    I got it, bro. Thanks

  • You could put your own answer, @Fellipe!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.