S
S
s0prano2018-12-06 16:31:28
Laravel
s0prano, 2018-12-06 16:31:28

Flexible fetching Laravel?

Hello.
I want to implement Laravel fetching by GET request parameters. I accept values ​​through $request->input(), how can I correctly substitute this array in ->where(), to select by key=value from the get request?
For example: /news?category_id=2¤cy=5
->where('category_id', 5)->where('currency', 5) etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2018-12-06
@JhaoDa

https://laravel.com/docs/5.7/queries#conditional-c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question