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

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Database\Factories\ProjectMemberFactory;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property string $id
* @property int|null $billable_rate
* @property string $project_id
* @property string $user_id
* @property-read Project $project
* @property-read User $user
*
* @method static ProjectMemberFactory factory()
*/
class ProjectMember extends Model
{
use HasFactory;
use HasUuids;
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'billable_rate' => 'int',
];
/**
* @return BelongsTo<Project, ProjectMember>
*/
public function project(): BelongsTo
{
return $this->belongsTo(Project::class, 'project_id');
}
/**
* @return BelongsTo<User, ProjectMember>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
}