Home > Back-end >  Laravel Datatables Problem Show Data Without Html Code
Laravel Datatables Problem Show Data Without Html Code

Time:03-04

enter image description here

My Code enter image description here

How to solve deskripsi without html code

CodePudding user response:

if i understood correctly you want to return a specific row from database and then print the field "deskripsi" of the row you returned. so from the method in php you can do:

$row = (your query)->first();

then in your blade file you can just do

<br><br>{{$row->deskripsi}}<br>

no need to use the html in your methods in php.

CodePudding user response:

I think you're using Yajra Datatables. Just add the column name to the rawColumns function, like:

->addColumm('deskripsi', function ($row) {
    return $row->deskripsi;
})
->rawColumns(['deskripsi'])
->make();
  • Related