. */ declare(strict_types=1); namespace FireflyIII\Http\Requests; /** * Class RuleFormRequest. * * @codeCoverageIgnore */ class TestRuleFormRequest extends Request { /** * Verify the request. * * @return bool */ public function authorize(): bool { // Only allow logged in users return auth()->check(); } /** * Rules for this request. * * @return array */ public function rules(): array { // fixed $validTriggers = array_keys(config('firefly.rule-triggers')); $rules = [ 'rule-trigger.*' => 'required|min:1|in:' . implode(',', $validTriggers), 'rule-trigger-value.*' => 'required|min:1|ruleTriggerValue', ]; return $rules; } }