Forms\Components\Section::make()
->schema([
Forms\Components\TextInput::make('code')
->label('Coupon code')
->suffixAction(
Forms\Components\Actions\Action::make('generate')
->label('Generate')
->color('gray')
->link()
->icon('heroicon-o-cog-8-tooth')
->action(function (Set $set) {
$set('code', strtoupper(Str::random(12)));
})
)
->visible(fn() => request()->get('type') === 'coupon' ? true : false)
->hint('Customers will enter this coupon code when they checkout.'),
Forms\Components\TextInput::make('promotionName')
->placeholder('Enter promotion name')
->visible(fn() => request()->get('type') === 'promotion' ? true : false),
]),
Forms\Components\Section::make()
->schema([
Forms\Components\TextInput::make('code')
->label('Coupon code')
->suffixAction(
Forms\Components\Actions\Action::make('generate')
->label('Generate')
->color('gray')
->link()
->icon('heroicon-o-cog-8-tooth')
->action(function (Set $set) {
$set('code', strtoupper(Str::random(12)));
})
)
->visible(fn() => request()->get('type') === 'coupon' ? true : false)
->hint('Customers will enter this coupon code when they checkout.'),
Forms\Components\TextInput::make('promotionName')
->placeholder('Enter promotion name')
->visible(fn() => request()->get('type') === 'promotion' ? true : false),
]),