Apply Filters Conditionally In Laravel With when()
– naxon.dev - submitted by Daniel Naxon
Ever needed to apply filters on a query conditionally, only when the user actually applies them? Laravel query builder's method when got you covered.
Read more [naxon.dev]