i write @ syntax in addcolumn on return datatables, but @ syntax can't render in blade template, @ syntax only plaintext. how i can render @ syntax?
this my code: http://pastebin.com/Sc2eG6us
can any help me? thank you before
Do it the other way around, add the columns only if they have the permissions.
$postsDataTable = Datatables::of($posts);
$actionButton = '';
if(\Entrust::can('pengguna-view')){
$actionButton = '<button name="button-drop" class="lihat-data btn-sm btn btn-default "
data-id="'.$datas->id.'"
data-username="'.$datas->username.'"
data-attribute="'.$datas->attribute.'"
data-op="'.$datas->op.'"
data-value="'.$datas->value.'"
data-barcode="'.$datas->barcode.'"
data-flag="'.$datas->flag.'"
data-dismiss="modal">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"> Lihat</span>
</button>';
}
$postsDataTable = $postsDataTable->addColumn('action',function($datas) use ($actionButton) {
return $actionButton;
});
}
return $postsDataTable->make(true);