<?php

namespace App\Http\Requests\Member;

use Illuminate\Foundation\Http\FormRequest;

// ══════════════════════════════════════════════════════════════════
//  InPractice — StoreSolutionRequest
//  Location: app/Http/Requests/Member/StoreSolutionRequest.php
//
//  Validates member solution submission and edits.
//  content: required, min 50 chars (forces real effort), max 5000
// ══════════════════════════════════════════════════════════════════

class StoreSolutionRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true; // Auth handled by middleware
    }

    public function rules(): array
    {
        return [
            'content' => ['required', 'string', 'min:50', 'max:5000'],
        ];
    }

    public function messages(): array
    {
        return [
            'content.required' => __('cases.solution_content_required'),
            'content.min'      => __('cases.solution_content_min'),
            'content.max'      => __('cases.solution_content_max'),
        ];
    }
}
