Sylius Academy Logo

How To Create Custom Resource

How To Create Custom Resource

Description

In this episode, we’ll create our first Sylius Resource: Brand. This is the resource we’ll be working on and gradually expanding throughout the rest of the course. We’ll start with the basics — simple properties like id, code, and name — and then build on top of them step by step later on.
 
In the second part of the video, we’ll run the debug:container command to see what registering an entity as a Sylius Resource actually gives us, followed by sylius:debug:resource.
 
Finally, we’ll create a simple test CLI command where we’ll use our resource together with its factory, repository, and manager.
    Resource Bundle Overview
    An introduction to the Sylius Resource Bundle — the core concept behind Sylius and the starting point for building CRUD-based e-commerce features.
    2:27
    How To Create Custom Resource
    Create your first Sylius Resource by building a Brand entity and explore what Sylius gives you out of the box, including factories, repositories, and resource debugging tools.
    18:01
    How To Customize Existing Resource
    Learn how to extend existing Sylius resources by adding a Brand relation to the Product and safely customizing core Sylius entities.
    11:56
    Resource Controller
    Understand the Sylius ResourceController, why Sylius uses a single generic controller, and how it works under the hood before using it in practice.
    9:22
    How To Expose Resource
    Expose a custom Brand resource in the Sylius admin, configure CRUD routes with a single routing definition, and explore how ResourceController works with Twig templates.
    13:26
    How To Create Custom Form
    Learn how to create custom Symfony forms for Sylius Resources by extending AbstractResourceType and applying them globally or per route.
    13:35
    Twig Hooks Overview
    Get introduced to Sylius Twig Hooks and learn how to inject custom Twig templates anywhere in the UI with a clean, backend-like approach.
    14:09
    How To Customize Existing Form
    Learn how to customize existing Sylius forms by adding, removing, and modifying fields and behavior with minimal effort.
    13:33
    How To Create Custom Repository
    Learn how to extend the default Sylius repository by creating and using a custom repository for advanced data access.
    6:32
    How To Extend Existing Repository
    Discover how to safely extend and customize existing Sylius repositories, including those already enhanced in the Sylius Core.
    12:32
    How To Customize Factory
    Learn how to create and use custom factories for Sylius Resources to control object creation logic.
    7:02
    Resource Controller Events
    Learn how Sylius uses an event-driven approach, which events are dispatched by the ResourceController, and how to extend behavior using event listeners.
    17:31