mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 12:12:15 +01:00
Added client and organization endpoints
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ use Laravel\Jetstream\Team as JetstreamTeam;
|
||||
|
||||
/**
|
||||
* @property string $id
|
||||
* @property string $name
|
||||
* @property bool $personal_team
|
||||
* @property User $owner
|
||||
*
|
||||
* @method HasMany<OrganizationInvitation> teamInvitations()
|
||||
@@ -31,6 +33,7 @@ class Organization extends JetstreamTeam
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'name' => 'string',
|
||||
'personal_team' => 'boolean',
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user