How to apply where condition only when the field value is not NULL
Laravel provides an elegant and flexible way to build database queries using Eloquent and Query Builder. Often, there might be scenarios where you need to apply a where condition only…