<?php

namespace App\Http\Requests\Auth;

use Illuminate\Foundation\Http\FormRequest;

class UpdateOwnPasswordRequest extends FormRequest
{
    public function authorize(): bool
    {
        return auth()->check();
    }

    public function rules(): array
    {
        return [
            'password' => ['required', 'string', 'min:6', 'max:50', 'same:confirmpassword'],
            'confirmpassword' => ['required', 'string', 'min:6', 'max:50'],
            'userid' => ['nullable', 'integer'],
        ];
    }
}
