FleetCart/Modules/Review/Admin/ProductTabsExtender.php
2023-06-11 13:14:03 +01:00

28 lines
632 B
PHP

<?php
namespace Modules\Review\Admin;
use Modules\Admin\Ui\Tab;
use Modules\Admin\Ui\Tabs;
class ProductTabsExtender
{
public function extend(Tabs $tabs)
{
$tabs->group('advanced_information')
->add($this->reviews());
}
private function reviews()
{
if (! request()->routeIs('admin.products.edit')) {
return;
}
return tap(new Tab('reviews', trans('review::reviews.tabs.products.reviews')), function (Tab $tab) {
$tab->weight(50);
$tab->view('review::admin.products.tabs.reviews');
});
}
}