ChatifyPHP

Installation

Install Chatify in a Laravel application with web or API authentication

Install the package

composer require munafio/chatify:^2.0@beta

If Composer rejects the beta constraint, add "minimum-stability": "beta" to your composer.json and run composer update.

If you plan to use Pusher as your broadcasting driver, also install the Pusher PHP SDK:

composer require pusher/pusher-php-server

Run the installer

php artisan chatify:install --with-ui

The --with-ui flag publishes the bundled messenger frontend. Omit it if you only need the API (headless mode).

The installer publishes:

AssetLocation
Configconfig/chatify.php
Migrationsdatabase/migrations/
Broadcast channelsroutes/chatify/channels.php
Blade viewsresources/views/vendor/chatify/
Compiled frontendpublic/vendor/chatify/
Wallpaper patternspublic/vendor/chatify/patterns/
Sound filespublic/vendor/chatify/sounds/

Database and storage

php artisan migrate
php artisan storage:link

Chatify creates six tables: ch_conversations, ch_conversation_participants, ch_messages, ch_favorites, ch_user_blocks, and ch_user_settings.

PHP upload temp directory

File uploads require PHP to have a writable temp directory. If uploads fail silently, point upload_tmp_dir in php.ini to a writable path:

upload_tmp_dir = /tmp

Or, on Windows / local dev, you can use your Laravel storage folder:

upload_tmp_dir = "C:\path\to\your-app\storage\framework\temp"

Authentication

Chatify requires authenticated users. You need an authentication system in place before Chatify routes will work.

Laravel Breeze is a good starting point for new projects. Any Laravel auth guard (session or token-based) works.

Choose your auth mode

Chatify supports two authentication modes. Set the CHATIFY_API_MIDDLEWARE environment variable to pick one.

Web (session) auth

Use this when you serve the bundled messenger UI and users log in via a normal Laravel session.

CHATIFY_API_MIDDLEWARE=web,auth
CHATIFY_WEB_ENABLED=true

This is the default. The bundled UI at /chatify uses session cookies to authenticate API requests.

API (token) auth

Use this for headless setups -- single-page apps, mobile clients, or any frontend that authenticates with Bearer tokens via Laravel Sanctum.

CHATIFY_API_MIDDLEWARE=api,auth:sanctum
CHATIFY_WEB_ENABLED=false

When CHATIFY_WEB_ENABLED=false, the web routes (/chatify) are not loaded. Your frontend hits the JSON API at api/chatify/v1/ directly.

Summary

ModeMiddlewareWeb UIAPI prefixAuth mechanism
Web (session)web,auth/chatifyapi/chatify/v1Session cookie
API (token)api,auth:sanctumDisabledapi/chatify/v1Bearer token (Sanctum)

Environment variables

Minimal web mode .env

CHATIFY_API_MIDDLEWARE=web,auth
BROADCAST_CONNECTION=pusher

PUSHER_APP_ID=your-app-id
PUSHER_APP_KEY=your-app-key
PUSHER_APP_SECRET=your-app-secret
PUSHER_APP_CLUSTER=mt1

Minimal API mode .env

CHATIFY_API_MIDDLEWARE=api,auth:sanctum
CHATIFY_WEB_ENABLED=false
BROADCAST_CONNECTION=pusher

PUSHER_APP_ID=your-app-id
PUSHER_APP_KEY=your-app-key
PUSHER_APP_SECRET=your-app-secret
PUSHER_APP_CLUSTER=mt1

See Broadcasting for Reverb and other WebSocket server configurations.

Verify

Web mode: log in and visit /chatify. You should see the messenger interface.

API mode: send a request to your API:

curl -H "Authorization: Bearer YOUR_TOKEN" \
     http://localhost:8000/api/chatify/v1/conversations

You should receive a JSON response with an empty conversation list.

Next step

Continue to Getting Started to wire up the User model and send your first message.

On this page