. */ declare(strict_types=1); namespace FireflyIII\Http\Requests; /** * @codeCoverageIgnore * Class RuleFormRequest. */ class TestRuleFormRequest extends Request { /** * @return bool */ public function authorize() { // Only allow logged in users return auth()->check(); } /** * @return array */ public function rules() { // 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; } }