How to add nightly build for PHP configuration?

I was following https://circleci.com/docs/2.0/language-php/ to create a configuration for my PHP project.

My current configuration is:

version: 2

jobs:
  build:
    machine: true

    steps:
      - ...

Then I decided to add a nightly scheduled build to it and found https://circleci.com/docs/2.0/workflows/#scheduling-a-workflow

So i added the nightly section to the config:

version: 2

jobs:
  build:
    machine: true

    steps:
      - ...

nightly:
  triggers:
    - schedule:
        cron: "0 0 * * *"

But it doesn’t work. What I’m doing wrong here?