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

@@ -9,13 +9,15 @@ use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Carbon;
/**
* @property string $id
* @property string $name
* @property string $organization_id
* @property string $created_at
* @property string $updated_at
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property-read Organization $organization
*
* @method static ClientFactory factory()
@@ -41,4 +43,12 @@ class Client extends Model
{
return $this->belongsTo(Organization::class, 'organization_id');
}
/**
* @return HasMany<Project>
*/
public function projects(): HasMany
{
return $this->hasMany(Project::class, 'client_id');
}
}