How to hide message on the remaining pages in laravel?

Babaev

I have the following including of templade blade in main layout:

 @if (Auth()->user()->verified == "0")
                @include('common.verify-error')
            @endif

So, how to display @include('common.verify-error') on the all URL excluding /test, /out

Should I do this in controller or simple if condition in template?

Mike Barwick

To start, there's probably a few different approaches to this. Personally, I'd do something along the lines of a middleware class...or inject a class in the view, etc.

However, he's another solution that may suit your needs better.

EDIT: Made a change. I'm assuming you use named routes (and should, in the event you want to change urls, etc. You won't have to deal with changing all these if statements for example).

@if (Auth()->user()->verified == "0" && !Route::is('test') && !Route::is('out'))
    @include('common.verify-error')
@endif

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to hide the error message?

From Dev

how to hide the error message in javascript

From Dev

how to hide the error message in javascript

From Dev

How to hide tab pages in a tab control

From Dev

Jekyll Github pages how to hide a post

From Dev

How to hide classes on some pages in WordPress?

From Dev

How to hide classes on some pages in WordPress?

From Dev

How To hide button when pages open in iframe?

From Dev

How to hide certain pages from search engines?

From Dev

How to wget IMDb message board pages?

From Dev

How to hide or disable in-function printed message

From Dev

How to hide flash message after few seconds?

From Dev

How to hide title/message frame in a UIAlertController?

From Dev

How to hide extra output from #pragma message

From Dev

How to hide Bootstrap alert box when no message

From Dev

How to hide "quodlibet wants to inhibit shortcuts" message

From Dev

How to hide empty categories in laravel

From Dev

laravel how to display flash message with confirm message

From Dev

OSX Pages - How to use roman numeral page numbers for introduction and decimal numbers for remaining paper

From Dev

How do I dynamically centre remaining stackpanel elements vertically when I hide items?

From Dev

How do I dynamically centre remaining stackpanel elements vertically when I hide items?

From Dev

How to Hide "Private" Show Pages from Other Users?

From Dev

How to hide an HTML element from appearing on other pages for desktop only?

From Dev

How can I hide the back button from certain pages in the shell?

From Dev

How can I hide the back button from certain pages in the shell?

From Dev

How to Hide "Private" Show Pages from Other Users?

From Dev

How to show hide multiple pages in angularjs in single section

From Dev

How to hide scroll bar on certain pages except for page 1?

From Dev

How to hide navigation menu in pages that are hidden in Navigation Menu in Liferay?

Related Related

  1. 1

    how to hide the error message?

  2. 2

    how to hide the error message in javascript

  3. 3

    how to hide the error message in javascript

  4. 4

    How to hide tab pages in a tab control

  5. 5

    Jekyll Github pages how to hide a post

  6. 6

    How to hide classes on some pages in WordPress?

  7. 7

    How to hide classes on some pages in WordPress?

  8. 8

    How To hide button when pages open in iframe?

  9. 9

    How to hide certain pages from search engines?

  10. 10

    How to wget IMDb message board pages?

  11. 11

    How to hide or disable in-function printed message

  12. 12

    How to hide flash message after few seconds?

  13. 13

    How to hide title/message frame in a UIAlertController?

  14. 14

    How to hide extra output from #pragma message

  15. 15

    How to hide Bootstrap alert box when no message

  16. 16

    How to hide "quodlibet wants to inhibit shortcuts" message

  17. 17

    How to hide empty categories in laravel

  18. 18

    laravel how to display flash message with confirm message

  19. 19

    OSX Pages - How to use roman numeral page numbers for introduction and decimal numbers for remaining paper

  20. 20

    How do I dynamically centre remaining stackpanel elements vertically when I hide items?

  21. 21

    How do I dynamically centre remaining stackpanel elements vertically when I hide items?

  22. 22

    How to Hide "Private" Show Pages from Other Users?

  23. 23

    How to hide an HTML element from appearing on other pages for desktop only?

  24. 24

    How can I hide the back button from certain pages in the shell?

  25. 25

    How can I hide the back button from certain pages in the shell?

  26. 26

    How to Hide "Private" Show Pages from Other Users?

  27. 27

    How to show hide multiple pages in angularjs in single section

  28. 28

    How to hide scroll bar on certain pages except for page 1?

  29. 29

    How to hide navigation menu in pages that are hidden in Navigation Menu in Liferay?

HotTag

Archive