ChatifyPHP

Upgrading & Version Guide

Understand the differences between Chatify v1 and v2, and how to migrate or stay on v1

Version overview

Chatify has two major versions. They are separate codebases -- v2 is not a drop-in upgrade from v1.

v1.x (^1.6)v2.x (^2.0@beta)
StatusStable (security fixes only)Beta (active development)
MessagingDirect (one-to-one) onlyDirect, group, and saved messages
FrontendjQuery + BladeVue 3 + Pinia + Tailwind CSS (IIFE bundle)
BroadcastingPusher onlyAny Laravel broadcasting driver (Pusher, Reverb, etc.)
PHP7.3+8.2+
Laravel7 – 1011, 12, 13
Databasech_messages, ch_favoritesch_conversations, ch_conversation_participants, ch_messages, ch_favorites, ch_user_blocks, ch_user_settings
Configchatify.php (flat)chatify.php (nested, expanded)
Routes/chatify + custom APIVersioned API at api/chatify/v1 + optional web UI
ModelsChMessage, ChFavoriteConversation, ConversationParticipant, Message, Favorite, UserBlock, UserSetting
AuthSession onlySession or Sanctum tokens

Staying on v1

If you have an existing v1 installation and it works for your needs, you can continue using it.

composer require munafio/chatify:^1.6
  • The v1 documentation remains at chatify.munafio.com
  • v1 receives security fixes only -- no new features
  • The ^1.6 constraint ensures Composer never pulls a v2 release

Starting fresh with v2

For new projects or major rebuilds, v2 is recommended.

composer require munafio/chatify:^2.0@beta
php artisan chatify:install --with-ui
php artisan migrate

Follow the Getting Started guide in this documentation.

If Composer rejects the beta constraint, add this to your composer.json:

{
  "minimum-stability": "beta",
  "prefer-stable": true
}

Migrating from v1 to v2

There is no automated migration path. The database schema, config format, routes, models, events, and frontend are all different.

Options

  1. Start fresh -- Install v2 on a clean database. Best for apps where chat history is not critical.
  2. Write a custom migration script -- Map your v1 data to the v2 schema manually.

Data mapping guide

If you choose option 2, here is how the v1 data maps to v2:

v1 table / columnv2 equivalent
ch_messages.from_idCreate a ch_conversations row (type direct), add both users to ch_conversation_participants, then insert into ch_messages with conversation_id and user_id = from_id
ch_messages.to_idThe other participant in ch_conversation_participants
ch_messages.bodych_messages.body
ch_messages.attachmentch_messages.attachment (format changed -- v2 uses a JSON object with name, type, size)
ch_messages.seenSet last_read_at on the recipient's ch_conversation_participants row
ch_favoritesch_favorites (schema is similar, but references user_id and favorite_user_id)

Key differences summary

Conceptv1v2
Config fileFlat keys (messenger_color, attachments.allowed_images, etc.)Nested sections (colors.list, attachments.allowed_images, etc.)
Route prefixchatify (hardcoded or via config)API: api/chatify/v1 (configurable), Web: chatify (configurable)
User traitChatify\Traits\ChatifyMessengerChatify\Traits\InteractsWithChatify
FacadeChatifyChatifyMessenger
EventsChatify\Events\MessageSent (single event)10 broadcast events (see Events)
ControllersSingle MessagesControllerSeparate controllers per resource (Conversation, Message, Contact, etc.)
Frontend buildManual Blade + jQueryphp artisan chatify:build (Vue 3 + Vite IIFE)
Middleware env varNot availableCHATIFY_API_MIDDLEWARE

Version constraints in Composer

ConstraintWhat you get
^1.6Latest v1 patch. Never jumps to v2.
^2.0@betaLatest v2 beta. Requires minimum-stability: beta or the @beta flag.
^2.0Stable v2 releases only (once v2 leaves beta).

Need help?

On this page