title: Render Permissions To HTML In Controller Laravel
body: <p>I have some html code in my controller for datatable actions (View , Edit &amp; Delete)
  So im busy working on permissions on a blade level. but now i'm struggling to render the same permissions to the HTML code that's in my controller.</p>
  
  <p>I'm using this syntax on my blades</p>
  
  <pre><code>@if(Auth::user()-&gt;can('Add New Client'))
       &lt;li&gt;&lt;a href="{{ route('add.client') }}"&gt;Add New Client&lt;/a&gt;&lt;/li&gt;
  @endif
  </code></pre>
  
  <p>And in my controller i have this code with renders action icons on my datatables</p>
  
  <pre><code>$nestedData['action'] = "&amp;emsp;&lt;a href='{$show}' title='View more' class='btn btn-xs btn-primary'&gt;&lt;i class='fa fa-eye'&gt;&lt;/i&gt;&amp;nbsp;View&lt;/a&gt;
                                 &lt;a href='{$edit}' title='Edit details' class='btn btn-xs btn-success'&gt;&lt;i class='fa fa-pencil'&gt;&lt;/i&gt;&amp;nbsp;Edit&lt;/a&gt;";
  </code></pre>
  
  <p>So just like i did on the blade level i also want to have a permission on the datatable buttons (show &amp; edit) to say</p>
  
  <pre><code>@if(Auth::user()-&gt;can('Edit Client'))
       &lt;a href='{$edit}' title='Edit details' class='btn btn-xs btn-success'&gt;&lt;i class='fa fa-pencil'&gt;&lt;/i&gt;&amp;nbsp;Edit&lt;/a&gt;"
  @endif
  </code></pre>
  
  <p>But when i put this code on the HTML in controller the code gets displayed on the form. I'm pretty new to laravel so any help will be highly appreciated.</p>