Corepine logo Corepine Wirechat
Login
Wirechat v0.6x latest

Quick Start

After installation, prepare your authenticated user model and open the default Wirechat panel.

Prepare the User Model

Your application user model must implement WirechatUser and use InteractsWithWirechat.

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Wirechat\Wirechat\Contracts\WirechatUser;
use Wirechat\Wirechat\Panel;
use Wirechat\Wirechat\Traits\InteractsWithWirechat;

class User extends Authenticatable implements WirechatUser
{
    use InteractsWithWirechat;

    public function canAccessWirechatPanel(Panel $panel): bool
    {
        return true;
    }

    public function canCreateChats(): bool
    {
        return true;
    }

    public function canCreateGroups(): bool
    {
        return true;
    }
}

These methods let your application decide who can access a panel, start private chats, and create groups.

Open the Default Panel

The installer creates a panel provider at app/Providers/Wirechat/ChatsPanelProvider.php.

By default, the panel uses the chats path:

use Wirechat\Wirechat\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        ->id('chats')
        ->path('chats')
        ->middleware(['web', 'auth'])
        ->default();
}

Visit /chats while authenticated to open the panel.

Start a Private Chat

With the default panel, users can start private conversations from the new-chat action.

  1. Open the Wirechat panel.
  2. Select the new-chat action.
  3. Search for a user.
  4. Select the user to open the conversation.
  5. Send the first message.

Customize who appears in search on the Users page.

Enable Common Features

Most features are enabled from the panel provider:

use Wirechat\Wirechat\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        ->attachments()
        ->settings()
        ->webPushNotifications();
}

Use Panels for the full panel API, then continue with Private Chats or Group Chats.