public function detachFile($page, $file)
    {
        $filesIds = $page->files->pluck('id')->toArray();
        $pivotData = [];
        $position = 1;
        foreach ($filesIds as $fileId) {
            if ($fileId != $file->id) {
                $pivotData[$fileId] = ['position' => $position++];
            }
        }
        $page->files()->sync($pivotData);
        $this->forgetCache();
    }