messages implemented
This commit is contained in:
25
app/Jobs/DeleteMessageFromIndexJob.php
Normal file
25
app/Jobs/DeleteMessageFromIndexJob.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\Message;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class DeleteMessageFromIndexJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public int $tries = 3;
|
||||
public int $timeout = 30;
|
||||
|
||||
public function __construct(public readonly int $messageId) {}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
Message::query()->whereKey($this->messageId)->unsearchable();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user