<?php

namespace App\Http\Requests\Posts;

use Illuminate\Foundation\Http\FormRequest;

class UpdatePostRequest extends FormRequest
{
    public function authorize(): bool
    {
        return (bool) $this->user();
    }

    public function rules(): array
    {
        return [
            'body'       => ['nullable', 'string', 'max:2000'],
            'visibility' => ['nullable', 'string', 'in:public,followers,private'],
        ];
    }
}
