src/Events/WorkspaceCreated.php defines a WorkspaceCreated event with payload (Workspace $workspace, mixed $owner), but nothing in the package dispatches it. The only reference to it under src/ is the class definition itself.
HasWorkspaces::createPersonalWorkspace() and createWorkspace() create the workspace via ownedWorkspaces()->create(...) and call joinWorkspace(), but never fire WorkspaceCreated. By contrast switchWorkspace() does dispatch WorkspaceSwitched, so the pattern is established but incomplete.
Impact
Host apps cannot react to workspace creation through the package's own event (for example, to seed per-workspace defaults such as a primary account or a default brand). They are pushed into model-level observers as a workaround, which duplicates intent the package already expresses.
Proposal
Dispatch WorkspaceCreated($workspace, $owner) when a workspace is created. Prefer firing it from the Workspace model's created boot hook so it covers every creation path (the two helper methods, factories, and direct create()), not only the helpers.
Acceptance
WorkspaceCreated fires once per created workspace, carrying the workspace and its owner.
- A test asserts dispatch for both
createPersonalWorkspace() and createWorkspace().
src/Events/WorkspaceCreated.phpdefines aWorkspaceCreatedevent with payload(Workspace $workspace, mixed $owner), but nothing in the package dispatches it. The only reference to it undersrc/is the class definition itself.HasWorkspaces::createPersonalWorkspace()andcreateWorkspace()create the workspace viaownedWorkspaces()->create(...)and calljoinWorkspace(), but never fireWorkspaceCreated. By contrastswitchWorkspace()does dispatchWorkspaceSwitched, so the pattern is established but incomplete.Impact
Host apps cannot react to workspace creation through the package's own event (for example, to seed per-workspace defaults such as a primary account or a default brand). They are pushed into model-level observers as a workaround, which duplicates intent the package already expresses.
Proposal
Dispatch
WorkspaceCreated($workspace, $owner)when a workspace is created. Prefer firing it from theWorkspacemodel'screatedboot hook so it covers every creation path (the two helper methods, factories, and directcreate()), not only the helpers.Acceptance
WorkspaceCreatedfires once per created workspace, carrying the workspace and its owner.createPersonalWorkspace()andcreateWorkspace().