Skip to content

Commit

Permalink
fix tostring issue
Browse files Browse the repository at this point in the history
  • Loading branch information
andy3471 committed Mar 14, 2024
1 parent 2154b5e commit e338732
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Traits/Entities/EntityAndModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ public function save(array $options = [])
*/
public function __toString()
{
return $this->getId();
return $this->getId() ?: '';
}
}
2 changes: 1 addition & 1 deletion src/Traits/Entities/Modelable.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public static function find($id)
public function __toString()
{
// TODO: This should be tidier
return $this->getId();
return $this->getId() ?: '';
}

/**
Expand Down

0 comments on commit e338732

Please sign in to comment.