FleetCart/Modules/Review/Admin/ReviewTable.php

27 lines
672 B
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Modules\Review\Admin;
use Modules\Admin\Ui\AdminTable;
class ReviewTable extends AdminTable
{
/**
* Make table response for the resource.
*
* @return \Illuminate\Http\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>';
});
}
}