PHP code example of nikservik / simple-support

1. Go to this page and download the library: Download nikservik/simple-support 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/ */

    

nikservik / simple-support example snippets


    // чтобы отключить любую возможность, достаточно ее закомментировать
    'features' => [
        'user-can-send-message',
        'user-can-update-message',
        'user-can-delete-message',
        'send-notifications-to-telegram',
//        'register-api-routes',
//        'autoload-migrations',
    ],

    // без / в начале и в конце
    'route' => 'support',

    // сколько сообщений загружается одним запросом
    'messages-per-page' => 20,

    // метод подсчета непрочитанных сообщений
    // fast - одним запросом с тремя вложенными
    // simple - тремя запросами
    'unread-count' => 'simple',

    // настройки для отправки уведомлений о новых сообщениях от пользователей
    'telegram' => [
        'url' => 'https://api.telegram.org/bot',
        'token' => env('SUPPORT_BOT_TOKEN'),
        'chat' => env('SUPPORT_BOT_CHAT'),
    ],
bash
php artisan vendor:publish --tag="simple-support-migrations"
bash
php artisan migrate
bash
php artisan vendor:publish --tag="simple-support-config"