generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Suggestion
To support method chaining and maintain consistency with other methods in the trait (like loadingIndicator), update the setSpinnerColor method so that it returns $this instead of void.
Current Implementation
query-builder/src/Support/Concerns/WithIndicator.php
Lines 32 to 35 in ab245a7
| $this->spinnerColor = $color; | |
| } | |
| public function showOverlay(): bool |
The method currently returns void, which breaks method chaining:
public function setSpinnerColor($color): void
{
$this->spinnerColor = $color;
}Proposed Change
public function setSpinnerColor($color): static
{
$this->spinnerColor = $color;
return $this;
}Benefits
- Enables fluent API pattern for method chaining
- Maintains consistency with the
loadingIndicator()method in the same trait - Does not break existing code (backward compatible)
- Allows for more concise configuration:
$builder->setSpinnerColor('text-green-500') ->loadingIndicator(true);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request