Added billable rates; Added project members; Added visibility to projects

This commit is contained in:
Constantin Graf
2024-03-28 18:50:04 +01:00
parent bb42b0940a
commit ba0212ea01
71 changed files with 3236 additions and 174 deletions

View File

@@ -20,6 +20,8 @@ use Laravel\Jetstream\Team as JetstreamTeam;
* @property string $id
* @property string $name
* @property bool $personal_team
* @property string $currency
* @property int|null $billable_rate
* @property User $owner
* @property Collection<User> $users
* @property Collection<string, User> $realUsers
@@ -40,6 +42,7 @@ class Organization extends JetstreamTeam
protected $casts = [
'name' => 'string',
'personal_team' => 'boolean',
'currency' => 'string',
];
/**
@@ -63,6 +66,15 @@ class Organization extends JetstreamTeam
'deleted' => TeamDeleted::class,
];
/**
* The model's default values for attributes.
*
* @var array<string, mixed>
*/
protected $attributes = [
'currency' => 'EUR',
];
/**
* Get all the non-placeholder users of the organization including its owner.
*
@@ -88,7 +100,10 @@ class Organization extends JetstreamTeam
public function users(): BelongsToMany
{
return $this->belongsToMany(Jetstream::userModel(), Jetstream::membershipModel())
->withPivot('role')
->withPivot([
'role',
'billable_rate',
])
->withTimestamps()
->as('membership');
}