Alex Puiu 2 years ago
parent
commit
e95f5af116
  1. 20
      app/SearchDisplace/SearchAndDisplaceJSON.php

20
app/SearchDisplace/SearchAndDisplaceJSON.php

@ -9,17 +9,31 @@ class SearchAndDisplaceJSON
{
protected $file;
protected $searchers;
protected $searchOnly;
protected $content;
public function __construct($file, $searchers)
public function __construct($file, $searchers, $searchOnly)
{
$this->file = $file . '/document.json';
$searchOnly ? $this->content = $file : $this->file = $file . '/document.json';
$this->searchers = $searchers;
$this->storage = Storage::disk('local');
}
public function execute()
{
if(isset($this->content)) {
$search = new SearchAndDisplace(
stripslashes($this->content),
[
'searchers' => $this->searchers,
],
true
);
return $search->execute();
}
if(! $this->storage->exists("contracts/$this->file")) {
return;
}

Loading…
Cancel
Save