FleetCart/Modules/Tax/Admin/TaxTabs.php

42 lines
1.1 KiB
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Modules\Tax\Admin;
use Modules\Admin\Ui\Tab;
use Modules\Admin\Ui\Tabs;
use Modules\Support\Country;
class TaxTabs extends Tabs
{
public function make()
{
$this->group('tax_information', trans('tax::taxes.tabs.group.tax_information'))
->active()
->add($this->general())
->add($this->rates());
}
2023-12-03 14:07:47 +00:00
2023-06-11 12:14:03 +00:00
private function general()
{
return tap(new Tab('general', trans('tax::taxes.tabs.general')), function (Tab $tab) {
$tab->active();
$tab->weight(5);
$tab->fields(['name']);
$tab->view('tax::admin.taxes.tabs.general');
});
}
2023-12-03 14:07:47 +00:00
2023-06-11 12:14:03 +00:00
private function rates()
{
return tap(new Tab('rates', trans('tax::taxes.tabs.rates')), function (Tab $tab) {
$tab->weight(10);
$tab->fields(['name', 'rates.*.name', 'rates.*.rate']);
$tab->view('tax::admin.taxes.tabs.rates', [
'countries' => Country::supported(),
]);
});
}
}