Entity, client, user, file, view and policy resources
resource_entity
Section titled “resource_entity”module is required. client defaults to the plan’s first client; fields follows the module schema; id is computed. Changing module replaces the entity. Entity resources support detach policy.
[{"resource_entity":"note","resource":{"module":"notes","fields":{"name":"Example"}}}]resource_client
Section titled “resource_client”Entity variant for a clients module. global is immutable; only one global client (id 0) exists. hostnames is a resource-level list (default []), outside fields. Prefer this type when Bakery should manage hostname associations.
[{"resource_client":"example","resource":{"module":"clients","global":false,"hostnames":["example.test"],"fields":{"title":"Example","identifier":"example"}}}]resource_user
Section titled “resource_user”Entity variant for a users module. root defaults to false; password is sensitive. Local environments replace the configured password with secret. The type identifier is singular.
[{"resource_user":"operator","resource":{"module":"users","root":false,"password":"${env('OPERATOR_PASSWORD')}","fields":{"name":"Operator","email":"operator@example.test"}}}]resource_file
Section titled “resource_file”Entity variant for a files module. path is required and points inside the system directory. hash records an immutable SHA-256 hash. fields is required; virtual_path is required with fallback /, and directory defaults to false.
[{"resource_file":"manual","resource":{"module":"files","path":"assets/manual.txt","fields":{"virtual_path":"/manual.txt","directory":false}}}]resource_view
Section titled “resource_view”Entity variant for a views module. fields.type accepts twig or blade. fields.filters is a list whose items require type, identifier and placeholder.
[{"resource_view":"greeting","resource":{"module":"views","fields":{"name":"greeting","type":"twig","code":"Hello","filters":[]}}}]For PDF, one Twig view supplies header/content/footer/setup blocks: PDF export.
resource_policy
Section titled “resource_policy”Entity variant for a policies module. fields.policy is DNF: outer OR groups, inner AND clauses. Each Bakery policy clause requires field, operator and recipe. Literal value clauses used directly in role filters are not this resource schema.
[{"resource_policy":"own_notes","resource":{"module":"policies","fields":{"name":"own_notes","policy":[[{"field":"owner.id","operator":"=","recipe":"$user.id"}]]}}}]See permission filters. Referenced modules and source files must exist before these entries are applied.
Source: app/Bakery/Plan/Resource/BakeryResource{Entity,Client,User,File,View,Policy}.php.