> For the complete documentation index, see [llms.txt](https://stack.sylius.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stack.sylius.com/resource/index.md).

# Resource Bundle documentation

## SyliusResourceBundle

The **Sylius Resource Bundle** provides a powerful and extensible foundation for exposing your **business resources** (entities, aggregates, etc.) in a declarative way.\
Rather than generating controllers or relying on rigid admin generators, it offers a flexible architecture that lets you focus on your domain model while the bundle handles the boilerplate.

A *Resource* is any business object you want to expose — for example, a `Product`, `Order`, or `UserProfile`.

Each resource can define a set of **operations** — actions that can be performed on it.\
Typical operations include `index`, `show`, `create`, `update`, and `delete`, but you can also define custom, domain-specific operations too.\
The bundle orchestrates each operation through a well-defined lifecycle involving **providers**, **processors**, and **responders**:

* **Providers** are responsible for loading or creating the resource object and **validating it** (ensuring the object is consistent before any business logic is applied).
  * Example: load from Doctrine, create a new instance, hydrate from request data, validate the object, or fetch from an external API.
* **Processors** handle the business logic or persistence layer (e.g. saving, executing domain services, dispatching events).
* **Responders** produce the final response (e.g. rendering a template).

This architecture allows you to use the bundle in two main ways:

* **Rapid Application Mode (RAD)** – perfect for quick CRUD setup with Doctrine ORM. You define your entity, mark it as a resource, and everything just works.
* **Domain-Driven Design / Advanced Mode** – where you control how data is provided and processed by writing your own providers and processors.

In short, the Sylius Resource Bundle is both **declarative** and **extensible** — define your resources and their operations, and let the framework handle the rest, while still giving you full control over the domain logic when you need it.

### Resource system for Symfony applications.

* [Installation](/resource/index/installation.md)

## New documentation

* [Resource lifecycle](/resource/index/lifecycle.md)
* [Create a new resource](/resource/index/create_new_resource.md)
* [Configure your resource](/resource/index/configure_your_resource.md)
* [Configure your operations](/resource/index/configure_your_operations.md)
* [Validation](/resource/index/validation.md)
* [Redirect](/resource/index/redirect.md)
* [Resource Factories](/resource/index/resource_factories.md)
* [Providers](/resource/index/providers.md)
* [Processors](/resource/index/processors.md)
* [Responders](/resource/index/responders.md)

## Deprecated documentation

* [Legacy Resource Documentation](/resource/index/index.md)

### Learn more

* [Resource Layer in the Sylius platform](https://docs.sylius.com/the-book/architecture/resource-layer) - concept documentation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://stack.sylius.com/resource/index.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
