Files
laravel-manager-packagist/src/Modules/Support/SupportModule.php
T
2026-12-05 19:00:02 +00:00

60 lines
1.7 KiB
PHP

<?php
namespace IriksIT\Manager\Modules\Support;
use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Helpdesk;
use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission;
/**
* Help from Iriks-IT: a form to ask a question or report a problem, which becomes a ticket at the IriksIT API with a number to follow it by,
* and a list of the tickets of the person with what Iriks-IT answered. Only there when the site has an API account (`manager.media.iriksit`).
*/
class SupportModule extends BaseModule
{
public function key(): string
{
return 'support';
}
public function label(): string
{
return 'Help';
}
public function enabledByDefault(): bool
{
return true;
}
public function tables(): array
{
return ['support_tickets'];
}
public function permissions(): array
{
return [new Permission('support.use', 'Ask Iriks-IT for help and follow the requests', 'Site')];
}
public function navigation(): array
{
if (! app(Helpdesk::class)->available()) {
return [];
}
return [['label' => 'Help', 'section' => 'Iriks-IT', 'route' => Names::route('support.index'), 'permission' => 'support.use', 'simple' => true, 'icon' => 'help', 'hint' => 'Ask a question or report a problem', 'order' => 90]];
}
public function actions(): array
{
return ['support.store' => ['Sent a request for help'], 'support.reply' => ['Answered a request for help']];
}
public function views(): array
{
return ['support.index' => 'Opened the help page', 'support.show' => 'Opened a request for help'];
}
}