anomaly/user-field_type
User field type for the Anomaly Streams platform (PyroCMS). Adds a user-select field to your forms and modules so editors can pick one or more registered users by name; stores their IDs for later lookup and display.
This is a Streams Platform field type addon, not a standalone Laravel package. It only makes sense inside a PyroCMS/Streams installation (it extends Anomaly\Streams\Platform\Addon\FieldType\FieldType and reads from the users module). If you are not already running the Streams Platform, this package will do nothing for you.
Minimal steps:
composer require anomaly/user-field_type
anomaly/users-module is installed and enabled — the field type sources its dropdown from Anomaly\UsersModule\User\UserModel / the users repository.php artisan addon:reload
php artisan cache:clear
anomaly.field_type.user.First use case: add a user field to a stream (e.g. an "Articles" stream with an "Author" field) so editors pick an existing user from a dropdown rather than typing an ID.
Assigning via stream migrations (the reproducible way). Prefer defining the field in your addon's migrations/ so it is version-controlled rather than clicked together in the admin:
$fields = $this->schema->fields();
$fields->add('author', 'anomaly.field_type.user');
$stream = $this->streams->streams()->create('articles', 'Anomaly\ArticlesModule\Article\ArticleModel');
Rendering in a form. Once the field is attached to a stream, the Streams form builder wires it in automatically:
{{ form('articles')->fields('author')->get() }}
Reading the value. The field type returns the related user object, so you can use it directly in Eloquent/Presenter contexts:
$article->author; // UserInterface|null
$article->author->display_name;
Constraining options. Typical config options on the field type let you restrict or label the select (e.g. a specific user "field"/column used as the option label, and role filtering where supported). Set these per-field in the admin config JSON or via migration ->setConfig([...]).
Multiple selection. Where the underlying select pattern is supported, set multiple config to allow assigning several users (useful for "assignees", "watchers").
Pairing with access control. A common workflow is to use a user field as the owner of a record and then scope queries or presenters against auth()->user() for "my items" views.
Extension point. To change how users are fetched (e.g. only active users, only a tenant), the reliable path is to subclass and override the option-collection method, then register your subclass as its own field type — the base class is small and meant to be extended.
anomaly/streams-platform. Confirm the platform boots before debugging this package.php artisan addon:list | grep users.$model->author == $userId; compare $model->author->id (and null-check — the field is often nullable).users.composer require or moving the package, field types won't register until php artisan addon:reload (or a full cache clear). This is the #1 "I installed it and nothing happened" cause.migrations/ makes schema reproducible across environments — critical given you can't rely on upstream fixes for anything you discover.anomaly.field_type.user and that the addon is enabled.How can I help you explore Laravel packages today?