X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/realesbar/platform/plugins/vendor/src/Forms
home
/
gfecatvj
/
sites
/
realesbar
/
platform
/
plugins
/
vendor
/
src
/
Forms
/
📁
..
📁
Fields
📄
PackageForm.php
(5.46 KB)
📄
PropertyForm.php
(2.16 KB)
📄
VendorForm.php
(3.82 KB)
Editing: PackageForm.php
<?php namespace Botble\Vendor\Forms; use Assets; use Botble\Base\Forms\FormAbstract; use Botble\Base\Enums\BaseStatusEnum; use Botble\RealEstate\Repositories\Interfaces\CurrencyInterface; use Botble\Vendor\Http\Requests\PackageRequest; use Botble\Vendor\Models\Package; class PackageForm extends FormAbstract { /** * @var CurrencyInterface */ protected $currencyRepository; /** * PackageForm constructor. * @param CurrencyInterface $currencyRepository */ public function __construct(CurrencyInterface $currencyRepository) { parent::__construct(); $this->currencyRepository = $currencyRepository; } /** * @return mixed|void * @throws \Throwable */ public function buildForm() { Assets::addScripts(['input-mask']); $currencies = $this->currencyRepository->pluck('currencies.title', 'currencies.id'); $this ->setupModel(new Package) ->setValidatorClass(PackageRequest::class) ->withCustomFields() ->add('name', 'text', [ 'label' => trans('core/base::forms.name'), 'label_attr' => ['class' => 'control-label required'], 'attr' => [ 'placeholder' => trans('core/base::forms.name_placeholder'), 'data-counter' => 120, ], ]) ->add('rowOpen1', 'html', [ 'html' => '<div class="row">', ]) ->add('price', 'text', [ 'label' => trans('plugins/vendor::package.price'), 'label_attr' => ['class' => 'control-label'], 'wrapper' => [ 'class' => 'form-group col-md-6', ], 'attr' => [ 'id' => 'price-number', 'placeholder' => trans('plugins/vendor::package.price'), 'class' => 'form-control input-mask-number', ], ]) ->add('currency_id', 'customSelect', [ 'label' => trans('plugins/vendor::package.currency'), 'label_attr' => ['class' => 'control-label'], 'wrapper' => [ 'class' => 'form-group col-md-6', ], 'attr' => [ 'class' => 'form-control select-full', ], 'choices' => $currencies, ]) ->add('rowClose1', 'html', [ 'html' => '</div>', ]) ->add('rowOpen2', 'html', [ 'html' => '<div class="row">', ]) ->add('percent_save', 'text', [ 'label' => trans('plugins/vendor::package.percent_save'), 'label_attr' => ['class' => 'control-label'], 'wrapper' => [ 'class' => 'form-group col-md-4', ], 'attr' => [ 'id' => 'percent-save-number', 'placeholder' => trans('plugins/vendor::package.percent_save'), 'class' => 'form-control input-mask-number', ], ]) ->add('number_of_listings', 'text', [ 'label' => trans('plugins/vendor::package.number_of_listings'), 'label_attr' => ['class' => 'control-label'], 'wrapper' => [ 'class' => 'form-group col-md-4', ], 'attr' => [ 'id' => 'price-number', 'placeholder' => trans('plugins/vendor::package.number_of_listings'), 'class' => 'form-control input-mask-number', ], ]) ->add('account_limit', 'text', [ 'label' => trans('plugins/vendor::package.account_limit'), 'label_attr' => ['class' => 'control-label'], 'wrapper' => [ 'class' => 'form-group col-md-4', ], 'attr' => [ 'id' => 'percent-save-number', 'placeholder' => trans('plugins/vendor::package.account_limit_placeholder'), 'class' => 'form-control input-mask-number', ], ]) ->add('rowClose2', 'html', [ 'html' => '</div>', ]) ->add('is_default', 'onOff', [ 'label' => trans('core/base::forms.is_default'), 'label_attr' => ['class' => 'control-label'], 'default_value' => false, ]) ->add('order', 'number', [ 'label' => trans('core/base::forms.order'), 'label_attr' => ['class' => 'control-label'], 'attr' => [ 'placeholder' => trans('core/base::forms.order_by_placeholder'), ], 'default_value' => 0, ]) ->add('status', 'customSelect', [ 'label' => trans('core/base::tables.status'), 'label_attr' => ['class' => 'control-label required'], 'attr' => [ 'class' => 'form-control select-full', ], 'choices' => BaseStatusEnum::labels(), ]) ->setBreakFieldPoint('status'); } }
Upload File
Create Folder