Archived
1
0
Fork 0

app/Models/Character.php: Add isMain()

This commit is contained in:
Henrik Hautakoski 2021-07-21 18:15:44 +02:00
parent 5211463513
commit 52bd1012a5

View file

@ -67,6 +67,14 @@ class Character extends Model
return $this->belongsTo(User::class);
}
/**
* Check if this character is the user's main character
*/
public function isMain()
{
return $this->user->character_id == $this->id;
}
/**
* Retrieve the character's professions.
*/