Get Variable from Component in View

How can I access the $maxStars variable in my view?
namespace App\Forms\Components;

use Filament\Forms\Components\Component;

class StarRating extends Component
{
protected string $view = 'forms.components.star-rating';

protected int $maxStars = 5;

public static function make(): static
{
return app(static::class);
}
}
namespace App\Forms\Components;

use Filament\Forms\Components\Component;

class StarRating extends Component
{
protected string $view = 'forms.components.star-rating';

protected int $maxStars = 5;

public static function make(): static
{
return app(static::class);
}
}
Solution:
Make it public variable and you can access it just by typinbg {{ $maxStars }}
Jump to solution
1 Reply
Solution
ModestasV
ModestasV15mo ago
Make it public variable and you can access it just by typinbg {{ $maxStars }}
Want results from more Discord servers?
Add your server