FleetCart/Modules/Review/Admin/ReviewTable.php
2023-12-03 14:07:47 +00:00

28 lines
690 B
PHP

<?php
namespace Modules\Review\Admin;
use Modules\Admin\Ui\AdminTable;
use Illuminate\Http\JsonResponse;
class ReviewTable extends AdminTable
{
/**
* Make table response for the resource.
*
* @return JsonResponse
*/
public function make()
{
return $this->newTable()
->editColumn('product', function ($review) {
return $review->product->name;
})
->editColumn('status', function ($review) {
return $review->is_approved
? '<span class="dot green"></span>'
: '<span class="dot red"></span>';
});
}
}