Laravel blade custom directive with include partial
<p>I have a custom Blade directive from which I'm trying to include a partial with the Blade syntax <code>@include()</code>. The problem is that I have a custom views namespace:</p>

<pre><code>\Blade::directive('name', function() {
    $viewsNamespace = 'viewsNameSpace::';
    $formPartial = $viewsNamespace . 'partials._form';
    return "{{ @include({$formPartial}) }}";
});
</code></pre>

<p><strong>This outputs the error,</strong></p>

<blockquote>
  <p><code>Class 'viewsNameSpace' not found</code> </p>
</blockquote>

<p>because its interpreting <code>viewsNameSpace::</code> as a class.</p>

<p>This outputs just the string without parsing it: </p>

<pre><code>return "@include('{$formPartial}')";
</code></pre>

<p>And this is not throwing any errors but its not loading the partial: </p>

<pre><code>return "{{ @include('{$formPartial}') }}";
</code></pre>

<p>Please note that the partial is working when I'm using in in a template like this:</p>

<pre><code>@include('viewsNameSpace::partials._form')
</code></pre>

<p>but I can't make it work from the directive.</p>

<p>Any help and suggestions would be appreciated! Thank you!</p>