Answers for "laravel if else condition in query"

PHP
-2

laravel if else condition in query

$query = SocialMediaFeed::where('location_id', $location_id);
if(!$filters) {
    $query = $query->where('self', '<>', true);
} else {
    $query = $query->orWhere('self', true);
}
Posted by: Guest on July-22-2020

Code answers related to "laravel if else condition in query"

Browse Popular Code Answers by Language