app/Models/Card.php: adding getSubjectTypeAttribute()
This commit is contained in:
parent
3762e92989
commit
65d7f4cdbe
1 changed files with 15 additions and 0 deletions
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue