https://a.storyblok.com/f/270183/1368x665/ba7e0e0e15/26jun_dev-blog_symfony-ai_r1.jpg

Symfony AI: How Many Prompts to Send an RCS Message?

Published on June 9, 2026

Time to read: 4 minutes

Call me “AI-curious/cautious”. As someone who has done software development “the manual way” and has learned design patterns in both Laravel and Symfony, I’ve already written about the alarmingly fast progress of how AI is affecting PHP developers in their day-to-day lives. So, I thought to myself, what if I tried to “code” a Laravel app from scratch that sent RCS messages? How many prompts would it take for me to get a Symfony app to take my Vonage credentials and send a test RCS message to me? Let’s find out!

Prerequisites

Once you have signed up, you’ll need to create an application and place the automatically downloaded private.key into the root of your project’s code.

  • To create an application, go to the Create an Application page on the Vonage Dashboard, and define a Name for your Application.

  • If you intend to use an API that uses Webhooks, you will need a private key. Click “Generate public and private key”, your download should start automatically. Store it securely; this key cannot be re-downloaded if lost. It will follow the naming convention private_<your app id>.key. This key can now be used to authenticate API calls. Note: Your key will not work until your application is saved.

  • Choose the capabilities you need (e.g., Voice, Messages, RTC, etc.) and provide the required webhooks (e.g., event URLs, answer URLs, or inbound message URLs). These will be described in the tutorial.

  • To save and deploy, click "Generate new application" to finalize the setup. Your application is now ready to use with Vonage APIs.

The Installation

One thing I’m not going to waste my precious tokens on is installing Symfony. A courteous look at the documentation will do just fine for me. Using Composer, I create a skeleton app:

composer create-project symfony/skeleton:"8.0.*" blog-symfony-ai-rcs

Next, we need to get the Vonage PHP SDK. I’ve included installing the Symfony HTTP client as well, as you cannot install the PHP SDK without having a PSR-7 compatible HTTP client.

composer require symfony/http-client

composer require vonage/client-sdk

Now, we start the clock. The requirements are this:

  • A command called SendRcsMessageCommand that takes a -text argument

  • When run and provided with a message, it takes an Application ID and private.key from your Vonage account (and configured with Symfony), boots the Vonage PHP SDK Client, and sends an RCS message to a pre-configured device number

Create the Command

Prompt:

create me a command called SendRcsMessageCommand that takes text as an argument 

Off it goes!

Screenshot of the command code with correct code importsImports all look present and correctAnd what are we left with?

Screenshot showing the execute method written according to Symfony standardsA healthy looking Symfony CommandLooks good to me, and has followed Symfony conventions. Step one: complete with no problems.

Add the Application ID and private.key path to the Symfony configuration, which is pulled in through an .env file.

Prompt:

add VONAGE_APPLICATION_ID and a private.key path to the .env file and configure it in Symfony

Should be pretty straightforward, although because this is starting to now use Symfony conventions (the configuration edit), I noticed it burned through a significantly higher amount of tokens.

If I add an example key and secret and tell the command to print it, we’ll see if it looks all good. First, I need to autowire the parameters in:

public function __construct(

   #[Autowire('%vonage.application_id%')] private readonly string $applicationId,

   #[Autowire('%vonage.private_key_path%')] private readonly string $privateKeyPath,

) {

   parent::__construct();

}

Now I add the code to spit out the container variables in the execute() method.:

// Check that the API Key and Secret have been configured corrects

$output->writeln('Checking autowired auth variables...');

$output->writeln('Application ID: ' . $this->applicationId);

$output->writeln('private key path: ' . $this->privateKeyPath);

Running the command and putting in some test values in the .env file renders the output:

symfony console app:send-rcs-message "hello world"

Sending RCS message: hello world

Checking autowired auth variables...

Application ID: test-key

private key path: %kernel.project_dir%/private.key

 Good. Two prompts so far.

In the services.yml file, I can see that it’s been edited to include these two parameters:

parameters:

   vonage.application_id: '%env(VONAGE_APPLICATION_ID)%'

   vonage.private_key_path: '%kernel.project_dir%/private.key'

Configure the Vonage PHP SDK and send an RCS message to a dummy number.

My curiosity is piqued at this point, because what will the agent do? Will it add the Vonage\Client in plain PHP, or will it attempt to use Symfony’s Service Container? The latter I doubt, unless I specifically tell it to.

Prompt:

add the vonage php sdk to the command and configure it with the api key and secret from the service configuration, then get it to send an RCS text message to a dummy number with the text parameter as the message

I want this, ideally, to be the final step. That makes 3, so can it do it? It changed the command’s execute() method to the following:

protected function execute(

   InputInterface $input,

   OutputInterface $output,

): int {

   $vonage = new Client(new Keypair(file_get_contents($this->privateKeyPath), $this->applicationId));

   $message = new RcsText(

       to: '447738066610',

       from: 'VonageRCSDemo-DevRel',

       message: $input->getArgument('text'),

   );

   $response = $vonage->messages()->send($message);

   $output->writeln(sprintf('RCS message sent. Message UUID: %s', $response['message_uuid']));

   return Command::SUCCESS;

}

Well, I’d say code-wise that looks absolutely perfect. So, what happens if I plug my credentials into the .env file and run the command? It’s the final test:

symfony console app:send-rcs-message "Hello from Symfony and Vonage!"

And here is the output in the terminal:

RCS message sent. Message UUID: 056c407b-b1db-4b9c-a4d4-322d2095b894

DING! My phone buzzes.

Screenshot of my Android phone with an RCS message delivered by my Symfony appAn alive and well RCS on my deviceThere it is. In a significant change from my last attempt to write a Laravel app using Cursor and Claude, the final count is three prompts, which is kind of unbelievable. Yes, it’s only sending an RCS message, but there’s plenty of scope to do more complex actions, such as consuming Webhooks or firing off Events to create other types of RCS messages, such as a prompt or a location, given the speed at which developers can prototype.

Remember the golden rule here: AI tooling is here to amplify and accelerate your code with Symfony. While I’m surprised that it’s taken so few prompts to do a task such as this, keep in mind that this new set of developer tools cannot replace your understanding of the code itself. For this reason, I highly recommend starting out on Symfony with SymfonyCasts, and especially looking up to the content created by the late and sadly missed Ryan Weaver. We are humans making software for humans, after all, and AI can’t replace that fact.

Have a question or want to share what you're building?

Stay connected and keep up with the latest developer news, tips, and events.

Share:

https://a.storyblok.com/f/270183/400x385/12b3020c69/james-seconde.png
James SecondeSenior PHP Developer Advocate

A trained actor with a dissertation on standup comedy, I came into PHP development via the meetup scene. You can find me speaking and writing on tech, or playing/buying odd records from my vinyl collection.