$document * @param array $payload */ public function handle(string $document, array $payload): BaseCompiler { return Tex::compile($document::fromApiRequest($payload)); } public function asController(ActionRequest $request): BaseCompiler { ValidateAction::validateType($request->input('type')); return $this->handle($request->input('type'), $request->input()); } /** * @return array */ public function rules(): array { return []; } }