Q: Laravel validation rules shared between Form request and Validator in command I have a set of validation rules in a FormRequest, Laravel 6.X like so:
    {
        return [
            'rule1' => 'required|numeric',
            'rule2' => 'required|numeric',
             ...,
            'ruleN.*.rule1' => ''required|string|max:50'
        ];
    }

This works just fine for every AJAX HTTP request against the endpoint for it was created. However, I also need to run the same process (Validate this time not against a Request but an array of inputs) via a CLI command, where this FormRequest cannot be used, as it won't be a Request.
By trying to inject the FormRequest into a Command like:
public function handle(CustomFormRequest $validator)
{
  ...
}

the command execution always fails (Of course), on every run, as the type of input isn't a Request.
Googling a bit I ended up with a solution of the shape of (Rules will be the same ofc):
$validator = Validator::make([
    'rule1' => $firstName,
    'rule2' => $lastName,
], [
    'rule1' => ['required'],
    'rule2' => ['required'],

]);

However I'd like to share the set of rules in a common place (A file for example) and that both the FormRequest AND the Validator class can take the same rules, without writing in both places (Form Request and Command), to keep them the same under any changes.
Is there  way of writing the "rules" array in a common place (A file for example) and import them into both places? Maybe a base class would work, but it doesn't look right to do it, as they don't share anything else than that. I thought of a Trait, but I'm hesitant tht could be the best solution.
