added roles and organizations
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-15 20:59:32 -07:00
parent 2ca3860557
commit 177f122c10
57 changed files with 6378 additions and 247 deletions
+34
View File
@@ -2,7 +2,9 @@
namespace Database\Factories;
use App\FolderVisibility;
use App\Models\Folder;
use App\Models\Organization;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
@@ -36,4 +38,36 @@ class FolderFactory extends Factory
'user_id' => $folder->user_id,
]);
}
/**
* Indicate that the folder sits in the given organization, inheriting the
* visibility the workspace defaults to.
*/
public function inOrganization(Organization $organization): static
{
return $this->state(fn (array $attributes) => [
'organization_id' => $organization->id,
'visibility' => Folder::defaultVisibilityFor($organization->id),
]);
}
/**
* Indicate that the folder is shared with everyone in its workspace.
*/
public function sharedWithWorkspace(): static
{
return $this->state(fn (array $attributes) => [
'visibility' => FolderVisibility::Workspace,
]);
}
/**
* Indicate that the folder is only visible to people it is shared with.
*/
public function private(): static
{
return $this->state(fn (array $attributes) => [
'visibility' => FolderVisibility::Private,
]);
}
}