Api Platform conference
Register now
API Platform Conference
September 17-18, 2026 | Lille & online

The international conference on the API Platform Framework

Secure your seat now before we sell out!

Join the event where Symfony and Laravel communities gather to share their expertise.

Only a few tickets left!

Validation with Laravel

API Platform simplifies the validation of data sent by clients to the API, typically user inputs submitted through forms.

You can add validation rules within the rules option:

// app/Models/Book.php

use ApiPlatform\Metadata\ApiResource;

#[ApiResource(
    rules: [
        'title' => 'required',
    ]
)]
class Book extends Model
{
}

You can also help us improve the documentation of this page.

Using an AI coding agent? See the documentation index for LLMs at /docs/llms.txt.

Made with love by

Les-Tilleuls.coop can help you design and develop your APIs and web projects, and train your teams in API Platform, Symfony, Next.js, Kubernetes and a wide range of other technologies.

Learn more

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop