app/Models/Character.php: Add isMain()
This commit is contained in:
parent
5211463513
commit
52bd1012a5
1 changed files with 8 additions and 0 deletions
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
Reference in a new issue