����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.170 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/builderbox/././www/vendor/laravel/scout/src/Jobs/ |
Upload File : |
<?php
namespace Laravel\Scout\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Str;
class RemoveFromSearch implements ShouldQueue
{
use Queueable, SerializesModels;
/**
* The models to be removed from the search index.
*
* @var \Illuminate\Database\Eloquent\Collection
*/
public $models;
/**
* Create a new job instance.
*
* @param \Illuminate\Database\Eloquent\Collection $models
* @return void
*/
public function __construct($models)
{
$this->models = RemoveableScoutCollection::make($models);
}
/**
* Handle the job.
*
* @return void
*/
public function handle()
{
if ($this->models->isNotEmpty()) {
$this->models->first()->searchableUsing()->delete($this->models);
}
}
/**
* Restore a queueable collection instance.
*
* @param \Illuminate\Contracts\Database\ModelIdentifier $value
* @return \Illuminate\Database\Eloquent\Collection
*/
protected function restoreCollection($value)
{
if (! $value->class || count($value->id) === 0) {
return new EloquentCollection;
}
return new EloquentCollection(
collect($value->id)->map(function ($id) use ($value) {
return tap(new $value->class, function ($model) use ($id) {
$keyName = $this->getUnqualifiedScoutKeyName(
$model->getScoutKeyName()
);
$model->forceFill([$keyName => $id]);
});
})
);
}
/**
* Get the unqualified Scout key name.
*
* @param string $keyName
* @return string
*/
protected function getUnqualifiedScoutKeyName($keyName)
{
return Str::afterLast($keyName, '.');
}
}