PHP code example of refineder / filament-crm

1. Go to this page and download the library: Download refineder/filament-crm library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

refineder / filament-crm example snippets


use Refineder\FilamentCrm\RefinederCrmPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(RefinederCrmPlugin::make());
}

'features' => [
    'contacts'          => true,
    'conversations'     => true,
    'deals'             => true,
    'whatsapp_sessions' => true,
    'widgets'           => true,
],

RefinederCrmPlugin::make()
    ->contacts(true)
    ->conversations(true)
    ->deals(true)
    ->whatsappSessions(true)
    ->widgets(true)
    ->navigationGroup('CRM')
    ->navigationSort(1)

'chat_poll_interval' => 5,

'currency' => 'USD',

'models' => [
    'contact'          => \App\Models\MyContact::class,
    'conversation'     => \App\Models\MyConversation::class,
    'message'          => \App\Models\MyMessage::class,
    'deal'             => \App\Models\MyDeal::class,
    'deal_stage'       => \App\Models\MyDealStage::class,
    'whatsapp_session' => \App\Models\MyWhatsappSession::class,
],

RefinederCrmPlugin::make()
    ->navigationGroup('My Custom CRM')

RefinederCrmPlugin::make()
    ->deals(false)         // hide the Deals resource
    ->widgets(false)       // remove dashboard widgets

use Refineder\FilamentCrm\Events\MessageReceived;

class NotifyTeamOnNewMessage
{
    public function handle(MessageReceived $event): void
    {
        $message = $event->message;
        $contact = $message->conversation->contact;

        // Send a notification to your team
        Notification::route('slack', config('services.slack.webhook'))
            ->notify(new NewWhatsAppMessage($contact, $message));
    }
}
bash
php artisan vendor:publish --tag="refineder-crm-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="refineder-crm-config"
bash
php artisan vendor:publish --tag="refineder-crm-translations"

lang/vendor/refineder-crm/
├── en/
│   ├── chat.php
│   ├── contacts.php
│   ├── conversations.php
│   ├── deals.php
│   ├── messages.php
│   ├── sessions.php
│   └── widgets.php
└── ar/
    └── ...