2

I have a query and use ->pluck and i see my result

[22]

$ferias = feria::where('id_funcionario', '=', $userid)->pluck('n_ferias_disponiveis');

I can see my result without [] ? For exemple use de select 'n_ferias_disponiveis', but how do you use select in the above query?

1
  • if you are looking for id and n_ferias_disponiveis then ->pluck('n_ferias_disponiveis','id_funcionario'); .Also note only two columns can select in pluck query not mroe than tht Commented Mar 13, 2022 at 9:21

1 Answer 1

1
$ferias = Feria::select('id_funcionario')->where('id_funcionario', '=', $userid)->get();

Pluck is collection function you should first get then you can use pluck method like:

$ferias = Feria::select('id_funcionario')->where('id_funcionario', '=', $userid)->get()->pluck('id_funcionario');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.