Caffeinated\Modules\Repositories\LocalRepository::set PHP Method

set() public method

Set the given module property value.
public set ( string $property, mixed $value ) : boolean
$property string
$value mixed
return boolean
    public function set($property, $value)
    {
        list($slug, $key) = explode('::', $property);
        $cachePath = $this->getCachePath();
        $cache = $this->getCache();
        $module = $this->where('slug', $slug);
        if (isset($module[$key])) {
            unset($module[$key]);
        }
        $module[$key] = $value;
        $module = collect([$module['basename'] => $module]);
        $merged = $cache->merge($module);
        $content = json_encode($merged->all(), JSON_PRETTY_PRINT);
        return $this->files->put($cachePath, $content);
    }