Php user/blueprints not picked up

OK,

I’m creating a permission plugin and using user(role) blueprints in site/blueprints/users/…
Like for instance a “viewer” role.

When I use a viewer.yml file I can add this user-role to any user in the control panel when logged in as Admin. But when I use a viewer.php (programmable) blueprint, this one is not picked up in the control panel ie users section, so I cannot apply the viewer-user-role to a user…

Do we have to register these php-blueprints explicitly? I thought Kirby would pick these up automagically?

Thanks in advance again (:-

Example: functioning user-role blueprint site/blueprints/users/viewer.yml:

title: Viewer
description: Can only view

permissions:
  access:
    panel: true
    settings: false
    users: false
    site: true

Non-functioning programmable version site/blueprints/users/viewer.php:

<?php
// site/blueprints/users/viewer.php

return [
    'title' => 'Viewer (from PHP)',
    'description' => 'This is a test to see if a PHP blueprint can be loaded.',
    'permissions' => [
        'access' => [
            'panel' => true
        ]
    ]
];

you are correct. Kirby will currently only autoload yaml based blueprints. Registering a PHP based blueprint needs to happen within a custom plugin.

<?php

use Kirby\Cms\App as Kirby;

Kirby::plugin('cookbook/programmable-blueprints', [
    'blueprints' => [
       'users/viewer' => [...], // <-- here
       'users/viewer' => require __DIR__ . '/path/to/blueprints/users/viewer.php', // <-- or like that
    ]
]);

Alternatives:

Thanks for the quick response!

Solved!