feat: add mood tracking (monicahq/chandler#386)

This commit is contained in:
Mazarin
2023-01-21 23:14:44 +00:00
committed by GitHub
parent de04fbab63
commit 44862a5b3f
49 changed files with 1989 additions and 48 deletions
+11
View File
@@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class MoodTrackingParameter extends Model
{
@@ -36,6 +37,16 @@ class MoodTrackingParameter extends Model
return $this->belongsTo(Vault::class);
}
/**
* Get the mood tracking events associated with the mood tracking parameter.
*
* @return HasMany
*/
public function moodTrackingEvents(): HasMany
{
return $this->hasMany(MoodTrackingEvent::class);
}
/**
* Get the label attribute.
* A mood tracking parameter has a default label that can be translated.