Файловый менеджер - Редактировать - /home/clickysoft/public_html/jmapi5.clickysoft.net/app/Http/Requests/Admin/CouponStoreRequest.php
Назад
<?php namespace App\Http\Requests\Admin; use App\Models\Coupon; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Gate; class CouponStoreRequest extends FormRequest { public function authorize(): bool { return Gate::allows('coupon_create'); } public function rules(): array { return [ 'code' => 'required|string|max:30|unique:coupons,code', 'discount_type' => 'required|in:' . implode(',', array_keys(Coupon::DISCOUNT_TYPE)), 'discount_value' => [ 'required', 'numeric', 'min:0', 'not_in:0', function ($attribute, $value, $fail) { if ($this->discount_type === 'percentage' && $value > 100) { $fail('The discount value cannot exceed 100% when the discount type is percentage.'); } }, ], 'expiry_date' => 'nullable|date|after:yesterday', 'number_of_usage' => 'nullable|numeric', 'status' => 'required|boolean', ]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка