<?php

namespace App\Http\Requests\Auth;

use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;

class TenantAdminTokenRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    /**
     * @return array<string, ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'login' => ['required', 'email'],
            'password' => ['required', 'string'],
        ];
    }

    public function credentials(): array
    {
        $login = $this->string('login')->trim()->value();

        return ['email' => $login, 'password' => $this->string('password')->value()];
    }
}
