Skip to content
This repository was archived by the owner on Jan 2, 2024. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update Component.php
  • Loading branch information
pascalbaljet committed Dec 22, 2020
commit 691e59dab6e2773876bfdf9111c1b645b55cab9e
10 changes: 7 additions & 3 deletions src/Components/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,14 @@ public function wireModifier(): ?string
*/
public function id(): string
{
if (!$this->id) {
$this->id = Str::random(4);
if ($this->id) {
return $this->id;
}

return $this->id;
if ($this->name) {
return $this->id = "auto_id_" . $this->name;
}

return $this->id = Str::random(4);
}
}