Home > Back-end >  How Laravel Where Query works with optional parameter passing
How Laravel Where Query works with optional parameter passing

Time:09-22

Hi guys I was wondering how this works. Can someone please explain

Internally defined Laravel Where method

public function where($column, $operator = null, $value = null, $boolean = 'and')

My Controller

User::where('id',2)->get();

This pulls User ID 2

So my question is how does Laravel know 2 is a value and not an operator

Thanks

CodePudding user response:

Here they describe it how they are identifying based on the number of argument passed to the function.

  • Related