/laravel-dashboard-helpscout-tile

A tile for the Laravel dashboard that shows the key numbers on you Helpscout mailbox

Primary LanguagePHPMIT LicenseMIT

A short description of the tile

Latest Version on Packagist GitHub Build Action Status Total Downloads

This tile displays the amount of active tickets, pending tickets and the amount of tickets that have been solved today.

This tile can be used on the Laravel Dashboard.

Screenshots

The background color of the open ticket count becomes brighter red when there are more open tickets.



Installation

  1. Require the package via composer
  2. Place all the necessary information in the config file, use the template below. ('app_id', 'app_secret' and 'mailboxes' are necessary. The others are optional.) (read https://developer.helpscout.com/docs-api/ for information about generating api keys)
  3. Place the tile component in your dashboard. Fill in the mailboxId in the tag.
  4. Schedule the command in the kernel.php.

Composer

You can install the package via composer:

composer require creacoon/laravel-dashboard-helpscout-tile 

Config file

In the dashboard config file, you must add this configuration in the tiles key. The mailboxes should contain an array of mailbox id's that you want to use on the dashboard.

// in config/dashboard.php

return [
    // ...
    'tiles' => [
         'helpscout' => [
            'app_id' => env('HELPSCOUT_APP_ID'),
            'app_secret' => env('HELPSCOUT_APP_SECRET'),
            'mailboxes' => explode(',', env('HELPSCOUT_MAILBOXES')),
            'active_tickets_full_alert' => 10,
            'refresh_interval_in_seconds' => 60,
            'no_active_tickets_text' => 'There are no tickets!',
        ]
    ],
];

Tile component

In your dashboard view you use the livewire:helpscout-tile component.

<x-dashboard>
    <livewire:helpscout-tile position="e7:e16" mailboxId="123456"/> 
</x-dashboard>

Schedule command

In app\Console\Kernel.php you should schedule the following commands.

protected function schedule(Schedule $schedule)
{
    // ...
           $schedule->command(FetchDataFromHelpscoutCommand::class)->everyFiveMinutes();
}

Customizing the view

If you want to customize the view used to render this tile, run this command:

php artisan vendor:publish --tag="dashboard-helpscout-tile-views"

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email support@creacoon.nl instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.