Fetch null values in Laravel Query
In my Laravel application if I use below query I am getting all values including null values.
Address::query();
But if I use below Query I am getting values from first_name starts with certain character and other columns value is not null.
Address::where('first_name', 'LIKE', $request->letter.'%')->get();
I would like to fetch values from first_name column starts with certain character and other columns value is null or not null both.
Thanks
This
Address::query();
just creates an instance of query builder and does not return any data at all
This
Address::where('first_name', 'LIKE', $request->letter.'%')->get();
returns all records where first_name begins with the specified letter. It does not care about the values of the other columns.
Do you want to re-state your problem please.
Please or to participate in this conversation.