<?php

namespace App\Http\Requests\Admin\Settings;

use Illuminate\Foundation\Http\FormRequest;

class UpdateSocialMediaRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->can('settings.update_social_media');
    }

    public function rules(): array
    {
        return [
            'instagram_url' => ['nullable', 'string', 'max:500'],
            'facebook_url' => ['nullable', 'string', 'max:500'],
            'tiktok_url' => ['nullable', 'string', 'max:500'],
        ];
    }

    public function attributes(): array
    {
        return [
            'instagram_url' => 'instagram',
            'facebook_url' => 'facebook',
            'tiktok_url' => 'tiktok',
        ];
    }
}
