Skip to content

Allow array of rules syntax in FormRequests #334

@spaceemotion

Description

@spaceemotion

Synopsis:

Instead of the normal string, separated by the pipe (|), It would be helpful to have an option to generate the array-based syntax instead.

Proposed Syntax:

Probably a config setting, rather than something done in the yaml:

<?php 

return [
	// ...
	'use_rules_array' => true, // default: false

This would also open up the ability to use the Rule class helpers instead of relying on just strings.

Expected Behavior:

Generates rules in form requests like so:

return [
	'column' => ['required', 'exists:users,email'],
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions