WireChat provides several upgrade commands to help migrate from older versions, update namespaces, and convert database schemas. These commands are essential when upgrading from legacy versions.
$ php artisan wirechat:upgrade-to-v0.3xStarting Wirechat upgrade to panel...Panel provider created at: app/Providers/Wirechat/ChatsPanelProvider.phpNo files found with Namu\WireChat to update.Registered provider: App\Providers\Wirechat\ChatsPanelProviderWirechat upgrade complete! Review the panel for any custom logic.
$ php artisan wirechat:upgrade-to-v0.3x --dry-runStarting Wirechat upgrade to panel...Dry run: Panel provider would be created at: app/Providers/Wirechat/ChatsPanelProvider.phpGenerated panel provider code:<?phpnamespace App\Providers\Wirechat;use Wirechat\Wirechat\Panel;use Wirechat\Wirechat\PanelProvider;use Wirechat\Wirechat\Support\Color;class ChatsPanelProvider extends PanelProvider{ public function panel(Panel $panel): Panel { return $panel ->id('chats') ->path('chats') ->emojiPicker() ->colors([ 'primary' => Color::Blue, ]) ->default(); }}Provider would be registered: App\Providers\Wirechat\ChatsPanelProviderDry run: No files found with Namu\WireChat to update.Dry run complete! No changes were made.
$ php artisan wirechat:upgrade-namespace-to-v0.3xStarting Wirechat namespace upgrade...Searching...Updated namespaces in the following files:./app/Models/User.php./database/migrations/2024_01_15_create_custom_table.php./app/Http/Controllers/ChatController.php
$ php artisan wirechat:upgrade-namespace-to-v0.3x --dry-runStarting Wirechat namespace upgrade...Searching...Dry run: Files that would be updated:./app/Models/User.php./database/migrations/2024_01_15_create_custom_table.php./app/Http/Controllers/ChatController.php
Windows: Requires Git Bash or WSL (Windows Subsystem for Linux)
If these utilities are not available on Windows:
This command requires find/sed (available in Git Bash or WSL on Windows). Please install Git Bash or WSL, or manually update Namu\WireChat to Wirechat\Wirechat.
The command adds these composite indexes for performance:
CREATE INDEX actions_actionable_idx ON wirechat_actions (actionable_id, actionable_type);CREATE INDEX actions_actor_idx ON wirechat_actions (actor_id, actor_type);CREATE INDEX actions_type_idx ON wirechat_actions (type);CREATE INDEX attachments_attachable_idx ON wirechat_attachments (attachable_id, attachable_type);