2lenet/crudit-bundle
Symfony bundle to rapidly build configurable CRUD back offices with SB Admin layout. Provides list views with pagination, sorting, actions, exports and batch ops, plus datasources, filters, menus, workflows, maps, markdown and Twig helpers.
Crudit supports Symfony's Workflow component.
To enable workflows for a field, you need to set the type :
$status = Field::new("status", WorkflowField::class);
And it's done !
Note that "workflow" also works.
The workflows transitions have roles on them.
The role is generated from this pattern : ROLE_<CRUDNAME>_WF_<transition>
Example : ROLE_USER_WF_TO_BANNED
Hyphens
-are replaced by underscores_
The WorkflowFilterType is available in Crudit.
You need to pass the workflow of your choice to the filter, like this :
public function __construct(WorkflowInterface $commandStateMachine)
{
// you may also use the Registry instead of injecting a WorkflowInterface
}
public function getFilters(): array
{
return [
WorkflowFilterType::new("state", $this->commandStateMachine),
];
}
How can I help you explore Laravel packages today?