Added client and organization endpoints

This commit is contained in:
Constantin Graf
2024-03-01 16:34:26 +01:00
parent a86e72f655
commit e8912650c0
18 changed files with 679 additions and 17 deletions

View File

@@ -31,16 +31,25 @@ class ProjectFactory extends Factory
public function forOrganization(Organization $organization): self
{
return $this->state(function (array $attributes) use ($organization) {
return $this->state(function (array $attributes) use ($organization): array {
return [
'organization_id' => $organization->getKey(),
];
});
}
public function withClient(): self
{
return $this->state(function (array $attributes): array {
return [
'client_id' => Client::factory(),
];
});
}
public function forClient(?Client $client): self
{
return $this->state(function (array $attributes) use ($client) {
return $this->state(function (array $attributes) use ($client): array {
return [
'client_id' => $client?->getKey(),
];