1
0
Fork 0

app/Models/Card.php: adding getSubjectTypeAttribute()

This commit is contained in:
Henrik Hautakoski 2022-01-02 21:18:13 +01:00
parent 3762e92989
commit 65d7f4cdbe

View file

@ -57,6 +57,21 @@ class Card extends Model
return "Somebody";
}
/**
* Who, Where or What this card belongs to.
*/
public function getSubjectTypeAttribute()
{
if ($this->character) {
return "Character";
} else if ($this->class) {
return "Class";
} else if ($this->role) {
return "Roll";
}
return "Anyone";
}
/**
* Get cards depending on settings.
*/