I do my conditional checks in the controller (not sure if this is the best practice).
$data = Datatables::of($profile)
->add_column('status', function ($result_obj) {
if ('Example' === $result_obj->status) {
return '<span>Example</span';
} else {
return 'Awesome';
}
})
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community