I have this page that uses include('src.modal') to include other .blade files and inside the modal I have @can directive that checks if user is authorized (@can('preview') ) on a single href element.
Result is that whenever the condition in @can is not met there exist an error that says modal not found. Is it normal for @can? Any help will be appreciated, thanks!
It is normal for the @can directive to throw an error if the condition is not met. To prevent this, you can wrap the @can directive in an @if statement. For example:
So it is redundant as a result. But base on the error that I encountered it is the whole modal that does not exist even though I only put it on a single href code block.