How to check query string exists or not in laravel blade

You can check query string exists or not in laravel blade with comparing the value with null. If query string is not exists in URL then it will return true while using comparision (=) operator.

Answers 1
  • Check query string exists or not in url in laravel blade

    @if(request()->get('page') == null)
        <p>Not Exists</p>
    @endif
    
    0

    This code snippet will help you to find out the query with key (page) exists or not in URI. If the condition is true, it means there in no query key exists with name page in URI in laravel blade file.

  • Back to code snippet queries related laravel