Host hook for core's own uploads (user avatars, branding logos, media selector uploads with a scope):
config :phoenix_kit, :uploads_parent_folder, {MyApp.Media, :parent_for}called as parent_for(kind, actor_uuid, subject) (or parent_for(kind, actor_uuid)),
kind ∈ :avatar | :branding, returning {:ok, folder_uuid} or nil (root, default).
actor_uuidis whoever is uploading. On the admin user form that is the admin andsubjectis the user being edited;Auth.update_user_avatar/4passes the avatar's owner as both.- The avatar and branding pickers pass the answer to
MediaSelectorModalasscope_folder_id, which also scopes browsing to that folder's subtree — files outside it are not offered in those pickers. - The pickers consult the hook when they open, not on page mount, so a hook that lazily creates its folder does so only when someone uploads.
- An answer that is not a UUID, names no folder, or names a trashed folder
is treated as
nil, as is a hook that raises or exits.
Summary
Functions
Attach file to the host folder for kind; no-op when the host answers nil.
Types
Functions
@spec place(PhoenixKit.Modules.Storage.File.t(), atom(), String.t() | nil, term()) :: :ok
Attach file to the host folder for kind; no-op when the host answers nil.