cleaner update
parent
8112212c95
commit
41a7cd65cf
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace App\Services\Registries;
|
||||
|
||||
use App\Models\Objects\Values\HtmlValue;
|
||||
use App\Models\Objects\Values\StringValue;
|
||||
use App\Models\Objects\Values\TextValue;
|
||||
use App\Models\Publications\Publication;
|
||||
use App\Models\Registries\Entry;
|
||||
use Illuminate\Support\Str;
|
||||
|
|
@ -11,8 +14,11 @@ class CleanerService {
|
|||
}
|
||||
|
||||
public function clean() {
|
||||
$this->cleanPublications();
|
||||
$this->cleanRegistryEntries();
|
||||
//$this->cleanPublications();
|
||||
//$this->cleanRegistryEntries();
|
||||
$this->cleanStringValues();
|
||||
$this->cleanTextValues();
|
||||
$this->cleanHtmlValues();
|
||||
}
|
||||
|
||||
public function cleanPublications() {
|
||||
|
|
@ -29,6 +35,25 @@ class CleanerService {
|
|||
}
|
||||
}
|
||||
|
||||
public function cleanStringValues() {
|
||||
$items = StringValue::all();
|
||||
foreach ($items as $item) {
|
||||
$item->update(['value' => $this->cleanString($item->value)]);
|
||||
}
|
||||
}
|
||||
public function cleanTextValues() {
|
||||
$items = TextValue::all();
|
||||
foreach ($items as $item) {
|
||||
$item->update(['value' => $this->cleanString($item->value)]);
|
||||
}
|
||||
}
|
||||
public function cleanHtmlValues() {
|
||||
$items = HtmlValue::all();
|
||||
foreach ($items as $item) {
|
||||
$item->update(['value' => $this->cleanString($item->value)]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function cleanString(?string $string): ?string {
|
||||
if ($string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue