name = $name; $this->description = $description; $this->id = md5(uniqid(rand(), true)); $this->storage = Storage::disk('local'); } abstract public function create(); protected function store() { $contents = [ 'id' => $this->id, 'name' => $this->name, 'description' => $this->description, 'rows' => $this->rows, ]; $this->storage->put("searchers/{$this->id}_{$this->name}.json", json_encode($contents)); } }