project = $project->load('rootFolders'); } public function selectFolder($folderId) { $this->selectedFolderId = $folderId; } public function toggleFolder($folderId) { if (in_array($folderId, $this->expandedFolders)) { $this->expandedFolders = array_diff($this->expandedFolders, [$folderId]); } else { $this->expandedFolders[] = $folderId; } } public function getDocumentsProperty() { return Document::where('folder_id', $this->selectedFolderId) ->where('project_id', $this->project->id) ->with('versions') ->get(); } public function render() { return view('livewire.project-show', [ 'rootFolders' => $this->project->rootFolders ]); } }