suminagashi/orchestra

Sleek admin for your symfony projects

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 19

Language:Vue

Type:symfony-bundle

dev-master 2020-08-19 11:22 UTC

README

orchestra

Sleek symfony admin boilerplate

Build Version Total Download License

Install the bundle :

Flex recipe incoming...

Register the bundle :

// config/bundles.php

return [
    ...
    Suminagashi\OrchestraBundle\OrchestraBundle::class => ['all' => true],
];

Register the route :

// config/routes/orchestra.yaml

orchestra_admin:
  resource: "@OrchestraBundle/Resources/config/routes.xml"
  prefix: /admin

Usage :

  • Orchestra provide 2 new annotations :
    • @Resource for class
    • @Field for properties
  • The data validation use Symfony\Component\Validator\Constraints annotation

Examples :

// src/Entity/Dummy.php

<?php

namespace App\Entity;

use Suminagashi\OrchestraBundle\Annotation\Resource;
use Suminagashi\OrchestraBundle\Annotation\Field;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @Resource(
 *  name="Dummy"
 * )
 */
class Dummy
{
    /**
     * @var string
     * @ORM\Column(type="string")
     * @Groups({"read", "write"})
     * @Field(label="Test")
     * @Assert\NotNull()
     */
    private $test;

    public function getTest(): ?string
    {
        return $this->test;
    }

    public function setTest(string $test): self
    {
        $this->test = $test;

        return $this;
    }
}

API Reference

@Resource

Attribute Description
label Used to set the label displayed in the menu
name Override default name of the resource
actions WIP : Set available CRUD operations