Installation
Install Chatify in a Laravel application with web or API authentication
Install the package
composer require munafio/chatify:^2.0@betaIf 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-serverRun the installer
php artisan chatify:install --with-uiThe --with-ui flag publishes the bundled messenger frontend. Omit it if you only need the API (headless mode).
The installer publishes:
| Asset | Location |
|---|---|
| Config | config/chatify.php |
| Migrations | database/migrations/ |
| Broadcast channels | routes/chatify/channels.php |
| Blade views | resources/views/vendor/chatify/ |
| Compiled frontend | public/vendor/chatify/ |
| Wallpaper patterns | public/vendor/chatify/patterns/ |
| Sound files | public/vendor/chatify/sounds/ |
Database and storage
php artisan migrate
php artisan storage:linkChatify 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 = /tmpOr, 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=trueThis 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=falseWhen CHATIFY_WEB_ENABLED=false, the web routes (/chatify) are not loaded. Your frontend hits the JSON API at api/chatify/v1/ directly.
Summary
| Mode | Middleware | Web UI | API prefix | Auth mechanism |
|---|---|---|---|---|
| Web (session) | web,auth | /chatify | api/chatify/v1 | Session cookie |
| API (token) | api,auth:sanctum | Disabled | api/chatify/v1 | Bearer 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=mt1Minimal 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=mt1See 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/conversationsYou 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.