Laravel - How to pass variable to layout partial view
<p>I have a partial view in master layout which is the navigation bar. I have a variable <code>$userApps</code>. This variable checks if the user has enabled apps (true), if enabled then I would like to display the link to the app in the navigation bar.</p>

<p>homepage extends master.layout which includes partials.navbar</p>

<p>My code in the navbar.blade.php is this:</p>

<pre><code>@if ($userApps)
    // display link
@endif
</code></pre>

<p>However I get an <strong>undefined variable error</strong>. If I use this in a normal view with a controller it works fine after I declare the variable and route the controller to the view. I dont think I can put a controller to a layout since I cant route a controller to a partial view, so how do I elegantly do this?</p>