Skip to content

Commit

Permalink
Update Setting.php
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvenga authored Jan 6, 2024
1 parent 7935f60 commit ea94e9b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Models/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
* @property int $id
* @property string $slug
* @property string|null $hint
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property-read string $name_human attribute
* @property-read int $settings_count
*/
class Setting extends Model
{
protected $guarded = [];
Expand All @@ -23,13 +32,12 @@ public function settingGroup(): BelongsTo

public function getNameHumanAttribute(): string
{

$string = $this->slug;

if (!empty($this->name)) {
return $string . ' (' . $this->name . ')';
if (! empty($this->name)) {
return $string.' ('.$this->name.')';
}

return $string;
}
}
}

0 comments on commit ea94e9b

Please sign in to comment.