Migrating from v0.2.x to v0.3.x
Version 0.3.0 introduces a major architectural shift from config-based to Panel-based settings. This provides a cleaner, more extensible way to define WireChat environments (e.g., user, admin, support panels).What Changed in v0.3.x
The major changes include:- Panels replace config-based settings: Each chat environment is now defined as a Panel provider
- Namespace change:
Namu\WireChat→Wirechat\Wirechat - New trait name:
Chatable→InteractsWithWireChat - New accessor methods: Prefixed with
wirechat(e.g.,getWirechatAvatarUrlAttribute) - Storage config keys:
attachments.*→storage.* - UUID config key:
uuids→uses_uuid_for_conversations - Polymorphic columns: Support for both UUID and bigint IDs
Run the namespace upgrade command to automatically update all references from
Namu\WireChat to Wirechat\Wirechat:.php files (excluding vendor and storage)Namu\WireChat with Wirechat\WirechatOn Windows, you’ll need Git Bash or WSL to run this command. Alternatively, manually replace namespaces in your IDE.
Run the morph columns upgrade command to ensure polymorphic relationships work with both UUID and bigint IDs:
actionable_id, actionable_type, actor_id, actor_type columns to VARCHARattachable_id and attachable_type columns to VARCHARuse Wirechat\Wirechat\Contracts\WireChatUser;
use Wirechat\Wirechat\Traits\InteractsWithWireChat;
class User extends Authenticatable implements WireChatUser
{
use InteractsWithWireChat;
}
public function getAvatarUrlAttribute(): ?string
public function getProfileUrlAttribute(): ?string
public function getDisplayNameAttribute(): string
public function getWirechatAvatarUrlAttribute(): ?string
public function getWirechatProfileUrlAttribute(): ?string
public function getWirechatDisplayNameAttribute(): string
return [
'uuids' => false,
'attachments' => [
'disk' => 'public',
'disk_visibility' => 'public',
],
];
return [
'uses_uuid_for_conversations' => false,
'storage' => [
'disk' => 'public',
'visibility' => 'public',
'directories' => [
'attachments' => 'attachments',
],
],
];
let userId = @js(auth()->id());
Echo.private(`participant.${userId}`)
.listen('.Namu\\Wirechat\\Events\\NotifyParticipant', (e) => {
console.log(e);
});
let userId = @js(auth()->id());
let encodedType = @js(Wirechat\Wirechat\Helpers\MorphClassResolver::encode(auth()->user()->getMorphClass()));
Echo.private(`participant.${encodedType}.${userId}`)
.listen('.Wirechat\\Wirechat\\Events\\NotifyParticipant', (e) => {
console.log(e);
});
New Features in v0.3.x
Panel-Based Configuration
Panel-Based Configuration
Generate new panel providers for different chat environments:This creates a dedicated panel provider where you can customize user search, storage, routes, and more.
Conditional Route Registration
Conditional Route Registration
Control when panel routes are registered:
Panel-Specific User Search
Panel-Specific User Search
Customize user search per panel:
TailwindCSS v4.0+ Support
TailwindCSS v4.0+ Support
Full support for the latest TailwindCSS version with improved theming.
Deprecated Features
These features still work but will be removed in a future version:- ❌
namu/wirechatpackage name - ❌
Namu\WireChatnamespace - ❌
Chatabletrait (useInteractsWithWireChat) - ❌ Legacy accessor methods without
wirechatprefix - ❌
uuidsconfig key (useuses_uuid_for_conversations) - ❌
attachments.*config keys (usestorage.*)