first upload all files
This commit is contained in:
39
Modules/Option/Admin/ProductTabsExtender.php
Normal file
39
Modules/Option/Admin/ProductTabsExtender.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Option\Admin;
|
||||
|
||||
use Modules\Admin\Ui\Tab;
|
||||
use Modules\Admin\Ui\Tabs;
|
||||
use Modules\Option\Entities\Option;
|
||||
|
||||
class ProductTabsExtender
|
||||
{
|
||||
public function extend(Tabs $tabs)
|
||||
{
|
||||
$tabs->group('advanced_information')
|
||||
->add($this->options());
|
||||
}
|
||||
|
||||
private function options()
|
||||
{
|
||||
if (! auth()->user()->hasAccess(['admin.options.create', 'admin.options.edit'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
return tap(new Tab('options', trans('option::options.tabs.product.options')), function (Tab $tab) {
|
||||
$tab->weight(35);
|
||||
|
||||
$tab->fields([
|
||||
'options.*.name',
|
||||
'options.*.type',
|
||||
'options.*.values.*.label',
|
||||
'options.*.values.*.price',
|
||||
'options.*.values.*.price_type',
|
||||
]);
|
||||
|
||||
$tab->view('option::admin.products.tabs.options', [
|
||||
'globalOptions' => Option::globals()->get(),
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user