Skip to content

Commit

Permalink
Two small (but important) fixes (#1525)
Browse files Browse the repository at this point in the history
* Update dependencies
* Fix User Model with name attribute
* preserve comment
* Fix migration

Co-authored-by: ildyria <beviguier@gmail.com>
  • Loading branch information
nagmat84 and ildyria authored Sep 23, 2022
1 parent 5884d4a commit c0a90b7
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 135 deletions.
2 changes: 1 addition & 1 deletion app/Http/Livewire/Sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function generateAlbumStructure()
['head' => Lang::get('ALBUM_PASSWORD'), 'value' => $_password],
];
if ($this->album->owner_id !== null) {
$share->content[] = ['head' => Lang::get('ALBUM_OWNER'), 'value' => $this->album->owner->name()];
$share->content[] = ['head' => Lang::get('ALBUM_OWNER'), 'value' => $this->album->owner->name];
}

$license = new \stdClass();
Expand Down
2 changes: 1 addition & 1 deletion app/Models/BaseAlbumImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function toArray(): array
{
$result = parent::toArray();
if (Auth::check()) {
$result['owner_name'] = $this->owner->name();
$result['owner_name'] = $this->owner->name;
}

return $result;
Expand Down
4 changes: 2 additions & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ public function username(): string
}

/**
* Used by Larapass.
* Used by Larapass since 2022-09-21.
*
* @return string
*/
public function name(): string
public function getNameAttribute(): string
{
// If strings starts by '$2y$', it is very likely that it's a blowfish hash.
return substr($this->username, 0, 4) === '$2y$' ? 'Admin' : $this->username;
Expand Down
Loading

0 comments on commit c0a90b7

Please sign in to comment.