Skip to content

Commit

Permalink
Always generate an id
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThompsonTLDR authored Oct 1, 2020
1 parent 098de5d commit e2b3b10
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/View/Components/Bs.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,19 +502,13 @@ private function label()
*/
private function id()
{
if ($id = Arr::get($this->options, 'id', true)) {
// auto generate label
if ($id === true) {
$id = Str::of($this->name);
// nothing passed
if (is_null(Arr::get($this->options, 'id', null))) {
$id = Str::of($this->name);

$id = $id->replace(['_', '[', ']', '.'], ' ');
$id = $id->replace(['_', '[', ']', '.'], ' ');

$this->options['id'] = trim((string) $id->slug());
}
// string was passed, not modify it
else {
$this->options['id'] = $id;
}
$this->options['id'] = trim((string) $id->slug());
}
}

Expand Down

0 comments on commit e2b3b10

Please sign in to comment.