Including subviews
The Blade @include
directive allows you to include a Blade view from within another view . All variables that are available for parent view are made available for viewing.
<div>
@include('shared.errors')
<form>
<!-- Form Contents -->
</form>
</div>
Although the included view inherits all available data in the parent view, you can also pass an array of extra data to the included view:
@include('view.name', ['some' => 'data'])
Of course, if you attempt a view that does not exist, Laravel will throw an error. If you would like to include a view that may or may not be present, you should use the directive: @includeIf
@includeIf('view.name', ['some' => 'data'])
If you'd like to include, depending on a particular Boolean condition, you can use the directive:
@includeWhen
@includeWhen($boolean, 'view.name', ['some' => 'data'])
To include the first view that exists for a particular view array, you can use the following directive:
@includeFirst
@includeFirst(['custom.admin', 'admin'], ['some' => 'data'])
Source: Official laravel documentation
I think the most appropriate approach would be:
@includeWhen(Auth::user()->mostrarMensagem, 'view.name');
This way you will only include this view if the variable is true