@@ -3,6 +3,7 @@
|
|||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
|
use App\Models\News;
|
||||||
use Illuminate\Http\Client\ConnectionException;
|
use Illuminate\Http\Client\ConnectionException;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
@@ -104,10 +105,10 @@ class XenforoApiService {
|
|||||||
if( !$entry->comments_thread_id || $entry->comments_thread_id <= 0 ){
|
if( !$entry->comments_thread_id || $entry->comments_thread_id <= 0 ){
|
||||||
$data = [
|
$data = [
|
||||||
'node_id' => config('xenforo.comments_node_id'),
|
'node_id' => config('xenforo.comments_node_id'),
|
||||||
'title' => $entry->complete_title,
|
'title' => $entry->complete_title ?? $entry->title,
|
||||||
'message' => $entry->description,
|
'message' => $entry->description,
|
||||||
'prefix_id' => config('xenforo.comments_prefixes')[$entry->type] ?? 1,
|
'prefix_id' => config('xenforo.comments_prefixes')[$entry->type ?? "news"] ?? 1,
|
||||||
'custom_fields' => [ 'entry_id' => $entry->id ],
|
'custom_fields' => $entry->type ? [ 'entry_id' => $entry->id ] : [ 'news_id' => $entry->id ],
|
||||||
'discussion_open' => true,
|
'discussion_open' => true,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user