I am using Laravel 5.4.18. I am trying to get data from database. The problem is I get plan text instead of data
The code
public function anyData()
{
$users = User::all();
return Datatables::of($users)
->editColumn('name', function($model){
return url('adminpanel/users/' . $model->id);
})
->editColumn('admin', function($model){
return $model->admin === 0
? '<span class="badge badge-info">User</span>'
: '<span class="badge badge-warning">Admin</span>';
})
->editColumn('control', function($model){
$all = '<a href="'.url('adminpanel/users/' . $model->id . '/edit').'" class="btn btn-info">
<i class="fa fa-edit"></i>
</a>';
})
->make(TRUE);
}
What I should get
Admin
What I actually get
<a href="http://realestate.dev/adminpanel/users/2/edit">Admin</a>
via hosam.shafik