fix bug
This commit is contained in:
@@ -18,9 +18,21 @@ class SupportChatController extends Controller
|
||||
{
|
||||
public function index(): View
|
||||
{
|
||||
if (app()->bound('debugbar')) {
|
||||
app('debugbar')->disable();
|
||||
}
|
||||
|
||||
$key = config('broadcasting.connections.reverb.key');
|
||||
|
||||
return view('nova.chat', [
|
||||
'chatCss' => $this->panelAsset('css/chat.css'),
|
||||
'chatScripts' => array_values(array_filter([
|
||||
$key ? $this->panelAsset('js/pusher.min.js') : null,
|
||||
$key ? $this->panelAsset('js/echo.iife.js') : null,
|
||||
$this->panelAsset('js/chat.js'),
|
||||
])),
|
||||
'pusher' => [
|
||||
'key' => config('broadcasting.connections.reverb.key'),
|
||||
'key' => $key,
|
||||
'host' => config('broadcasting.connections.reverb.options.host'),
|
||||
'port' => (int) config('broadcasting.connections.reverb.options.port', 8080),
|
||||
'scheme' => config('broadcasting.connections.reverb.options.scheme', 'http'),
|
||||
@@ -89,4 +101,13 @@ class SupportChatController extends Controller
|
||||
|
||||
return $support;
|
||||
}
|
||||
|
||||
private function panelAsset(string $relative): string
|
||||
{
|
||||
$path = public_path('assets/panel/'.$relative);
|
||||
|
||||
abort_unless(is_readable($path), 500, "Missing chat asset [{$relative}].");
|
||||
|
||||
return (string) file_get_contents($path);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user