team folders page

This commit is contained in:
Peter Papp
2021-08-26 12:20:36 +02:00
parent 7020720392
commit bee7352b28
21 changed files with 620 additions and 73 deletions

View File

@@ -125,7 +125,8 @@ class User extends Authenticatable implements MustVerifyEmail
public function getFolderTreeAttribute(): Collection
{
return Folder::with(['folders.shared', 'shared:token,id,item_id,permission,is_protected,expire_in'])
->where('parent_id', null)
->where('parent_id')
->where('team_folder', false)
->where('user_id', $this->id)
->sortable()
->get();
@@ -145,6 +146,7 @@ class User extends Authenticatable implements MustVerifyEmail
public function favouriteFolders(): BelongsToMany
{
return $this->belongsToMany(Folder::class, 'favourite_folder', 'user_id', 'folder_id', 'id', 'id')
->where('team_folder', false)
->with('shared:token,id,item_id,permission,is_protected,expire_in');
}