<?php

namespace Tricks\CampaignMonitor\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Str;

class CampaignMonitorRequest extends FormRequest
{
    public function rules(): array
    {
        $routeName = $this->route()->getName();
        $mailSlug = Str::afterLast($routeName, '.');

        return config('campaignmonitor.transactional.mails.'.$mailSlug.'.rules', []);
    }
}
